repo_id stringclasses 400
values | cross_repo_split stringclasses 1
value | commit_index int32 0 1.19k | commit_sha stringlengths 40 40 | in_repo_split stringclasses 3
values | test_file stringlengths 7 121 | file_split stringclasses 3
values | split_group stringlengths 18 150 | lineno int32 1 5.24k | col_offset int32 0 165 | assertion_type stringclasses 35
values | test_function stringlengths 0 141 | prefix large_stringlengths 7 258k | target stringlengths 1 29.2k | assertion_event_type stringclasses 2
values | assertion_event_id stringlengths 64 64 | assertion_anchor large_stringlengths 14 176k | old_target stringlengths 1 11.2k ⌀ | old_lineno int32 2 4.91k ⌀ | old_col_offset int32 0 165 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
urllib3/urllib3 | train | 289 | 7b2921381ca7a2881cf873647aca00e7561a8f0c | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 212 | 8 | assert | test_unparse_url | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | expected_url.url | added | a377d1f3b1acad1cc61bed0bf456cae3c5c1800b9aca1d9e643a652f28235c0b | assert|test_unparse_url|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL ... | null | null | null |
urllib3/urllib3 | train | 289 | 7b2921381ca7a2881cf873647aca00e7561a8f0c | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 293 | 8 | assert | test_parse_url_unicode_python_2 | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | isinstance(url.scheme, six.text_type) | added | a8f5d9770e62b03ac9bacd60ff38bce69d70bf8717be91c63c1be23c4ddf4c64 | assert|test_parse_url_unicode_python_2|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_bod... | null | null | null |
urllib3/urllib3 | train | 289 | 7b2921381ca7a2881cf873647aca00e7561a8f0c | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 482 | 8 | assert | test_resolve_cert_reqs | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | requirements | added | 082f5c4eb6f3dead9c6dc18331e8ad6198f5ddfe7ed32bfb8a70bb92f305128a | assert|test_resolve_cert_reqs|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILE... | null | null | null |
urllib3/urllib3 | train | 289 | 7b2921381ca7a2881cf873647aca00e7561a8f0c | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 521 | 13 | pytest.raises | test_is_fp_closed_object_has_neither_fp_nor_closed | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | ValueError) | added | 62bc8cbad6b4381be4a86c26418d68ab8d00338ce875e4d6da05fd20c8556e4f | pytest.raises|test_is_fp_closed_object_has_neither_fp_nor_closed|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request impor... | null | null | null |
urllib3/urllib3 | train | 290 | adb358f8e06865406d1f05e581a16cbea2136fbc | train | test/test_retry.py | train | urllib3/urllib3:test/test_retry.py | 256 | 8 | assert | test_retry_default_remove_headers_on_redirect | import pytest
from urllib3.response import HTTPResponse
from urllib3.packages.six.moves import xrange
from urllib3.util.retry import Retry, RequestHistory
from urllib3.exceptions import (
ConnectTimeoutError,
MaxRetryError,
ReadTimeoutError,
ResponseError,
)
class TestRetry(object):
def test_str... | ['authorization'] | modified | b9718f433f84ce8086d7997dc195797a8514f5c7b26a4f8b794bb8953335fc94 | assert|test_retry_default_remove_headers_on_redirect|import pytest from urllib3.response import HTTPResponse from urllib3.packages.six.moves import xrange from urllib3.util.retry import Retry, RequestHistory from urllib3.exceptions import ( ConnectTimeoutError, MaxRetryError, ReadTimeoutError, ResponseError, ) class Te... | ['Authorization'] | 256 | 8 |
urllib3/urllib3 | train | 290 | adb358f8e06865406d1f05e581a16cbea2136fbc | train | test/test_retry.py | train | urllib3/urllib3:test/test_retry.py | 261 | 8 | assert | test_retry_set_remove_headers_on_redirect | import pytest
from urllib3.response import HTTPResponse
from urllib3.packages.six.moves import xrange
from urllib3.util.retry import Retry, RequestHistory
from urllib3.exceptions import (
ConnectTimeoutError,
MaxRetryError,
ReadTimeoutError,
ResponseError,
)
class TestRetry(object):
def test_str... | ['x-api-secret'] | modified | 67fbf370716f7d5cbac57dae3357ba07d71bce4b0817cefa455746f07767f0be | assert|test_retry_set_remove_headers_on_redirect|import pytest from urllib3.response import HTTPResponse from urllib3.packages.six.moves import xrange from urllib3.util.retry import Retry, RequestHistory from urllib3.exceptions import ( ConnectTimeoutError, MaxRetryError, ReadTimeoutError, ResponseError, ) class TestRe... | ['X-API-Secret'] | 261 | 8 |
urllib3/urllib3 | train | 290 | adb358f8e06865406d1f05e581a16cbea2136fbc | train | test/with_dummyserver/test_poolmanager.py | train | urllib3/urllib3:test/with_dummyserver/test_poolmanager.py | 244 | 8 | self.assertEqual | test_missing_port | import unittest
import json
import pytest
from dummyserver.server import HAS_IPV6
from dummyserver.testcase import (HTTPDummyServerTestCase,
IPv6HTTPDummyServerTestCase)
from urllib3.poolmanager import PoolManager
from urllib3.connectionpool import port_by_scheme
from urllib3.excepti... | b'Dummy server!') | added | e0b34cca2cf9184d00917f14fa65805905efd14410d937f4409c81d683917c6c | self.assertEqual|test_missing_port|import unittest import json import pytest from dummyserver.server import HAS_IPV6 from dummyserver.testcase import (HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase) from urllib3.poolmanager import PoolManager from urllib3.connectionpool import port_by_scheme from urllib3.exceptio... | null | null | null |
urllib3/urllib3 | train | 290 | adb358f8e06865406d1f05e581a16cbea2136fbc | train | test/with_dummyserver/test_poolmanager.py | train | urllib3/urllib3:test/with_dummyserver/test_poolmanager.py | 268 | 8 | self.assertIsNone | test_headers | import unittest
import json
import pytest
from dummyserver.server import HAS_IPV6
from dummyserver.testcase import (HTTPDummyServerTestCase,
IPv6HTTPDummyServerTestCase)
from urllib3.poolmanager import PoolManager
from urllib3.connectionpool import port_by_scheme
from urllib3.excepti... | returned_headers.get('Foo')) | added | 5796767f063a17b35486e9c0ae5c5fecb9c3c7830b9d68dfd7fb8da6c93951ef | self.assertIsNone|test_headers|import unittest import json import pytest from dummyserver.server import HAS_IPV6 from dummyserver.testcase import (HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase) from urllib3.poolmanager import PoolManager from urllib3.connectionpool import port_by_scheme from urllib3.exceptions i... | null | null | null |
urllib3/urllib3 | train | 290 | adb358f8e06865406d1f05e581a16cbea2136fbc | train | test/with_dummyserver/test_poolmanager.py | train | urllib3/urllib3:test/with_dummyserver/test_poolmanager.py | 273 | 8 | self.assertIsNone | test_headers | import unittest
import json
import pytest
from dummyserver.server import HAS_IPV6
from dummyserver.testcase import (HTTPDummyServerTestCase,
IPv6HTTPDummyServerTestCase)
from urllib3.poolmanager import PoolManager
from urllib3.connectionpool import port_by_scheme
from urllib3.excepti... | returned_headers.get('Foo')) | added | 915db5b131cfd0b7160fa56588b38aa15666bdb6f795a13deefb4adf303f0e3b | self.assertIsNone|test_headers|import unittest import json import pytest from dummyserver.server import HAS_IPV6 from dummyserver.testcase import (HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase) from urllib3.poolmanager import PoolManager from urllib3.connectionpool import port_by_scheme from urllib3.exceptions i... | null | null | null |
urllib3/urllib3 | train | 290 | adb358f8e06865406d1f05e581a16cbea2136fbc | train | test/with_dummyserver/test_poolmanager.py | train | urllib3/urllib3:test/with_dummyserver/test_poolmanager.py | 274 | 8 | self.assertEqual | test_headers | import unittest
import json
import pytest
from dummyserver.server import HAS_IPV6
from dummyserver.testcase import (HTTPDummyServerTestCase,
IPv6HTTPDummyServerTestCase)
from urllib3.poolmanager import PoolManager
from urllib3.connectionpool import port_by_scheme
from urllib3.excepti... | 'quux') | added | d8bb366b2487799f1424d06b714a9c226015a2b8205ac10d6220d2ca814f83e4 | self.assertEqual|test_headers|import unittest import json import pytest from dummyserver.server import HAS_IPV6 from dummyserver.testcase import (HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase) from urllib3.poolmanager import PoolManager from urllib3.connectionpool import port_by_scheme from urllib3.exceptions im... | null | null | null |
urllib3/urllib3 | train | 291 | d5e0eb64dd14840cd3794fabcd81ee52a5e6f3e8 | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 374 | 8 | assert | test_split_first | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | expected | modified | 4eabc17eb7c3babd07975af853a61ec192a06ee062575972c0d9631ceac31502 | assert|test_split_first|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL ... | expected | 373 | 8 |
urllib3/urllib3 | train | 291 | d5e0eb64dd14840cd3794fabcd81ee52a5e6f3e8 | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 446 | 8 | assert | test_timeout | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | None | modified | 24a17354bbe6461b510b2a14c979f579721dd8034f80dd744feaedb462c22c5c | assert|test_timeout|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL from... | None | 445 | 8 |
urllib3/urllib3 | train | 291 | d5e0eb64dd14840cd3794fabcd81ee52a5e6f3e8 | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 463 | 13 | pytest.raises | test_timeout_elapsed | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | TimeoutStateError) | modified | f064e9171d25905c5660f2b40da74b814a02a294c8578d1bc476885b2a695ad7 | pytest.raises|test_timeout_elapsed|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _... | TimeoutStateError) | 462 | 13 |
urllib3/urllib3 | train | 291 | d5e0eb64dd14840cd3794fabcd81ee52a5e6f3e8 | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 616 | 12 | assert | test_has_ipv6_disabled_on_appengine | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | not _has_ipv6('::1') | modified | 332b6fe773abc04e9e2264ca5cbc5d7bfe312bc736ec4fb64d6236f9d13d2519 | assert|test_has_ipv6_disabled_on_appengine|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind... | not _has_ipv6('::1') | 615 | 12 |
urllib3/urllib3 | train | 292 | 791e9b4a97d71e6fccb11b4d1c67b01cc0848776 | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 129 | 8 | assert | test_client_key_password | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | subject['organizationalUnitName'].startswith( 'Testing server cert') | added | f1875a378c18321f6df26be9f3739aa5896fa4457a25c0ab2af6064330ae3963 | assert|test_client_key_password|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS... | null | null | null |
urllib3/urllib3 | train | 292 | 791e9b4a97d71e6fccb11b4d1c67b01cc0848776 | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 294 | 12 | self.assertTrue | test_verified_without_ca_certs | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | 'No root certificates specified' in str(e.reason) or 'certificate verify failed' in str(e.reason) or 'invalid certificate chain' in str(e.reason)) | added | a73906229f8cfcefea7ce2d028040624e83c6b514550187e1d47db47ef1bf5ca | self.assertTrue|test_verified_without_ca_certs|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD... | null | null | null |
urllib3/urllib3 | train | 292 | 791e9b4a97d71e6fccb11b4d1c67b01cc0848776 | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 350 | 12 | self.assertEqual | test_ssl_unverified_with_ca_certs | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | InsecureRequestWarning) | added | 574a7d82eab89a91a878bc2eda275316d4877b82ddc13cfa0e412763e21affba | self.assertEqual|test_ssl_unverified_with_ca_certs|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAULT_CA... | null | null | null |
urllib3/urllib3 | train | 292 | 791e9b4a97d71e6fccb11b4d1c67b01cc0848776 | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 453 | 13 | self.assertRaises | test_verify_none_and_bad_fingerprint | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | MaxRetryError) | added | 6796e37ecf836d3fb8d314556b6fa8cc132f2179d1add8877e22e1b451b0dad2 | self.assertRaises|test_verify_none_and_bad_fingerprint|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAUL... | null | null | null |
urllib3/urllib3 | train | 292 | 791e9b4a97d71e6fccb11b4d1c67b01cc0848776 | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 345 | 8 | self.assertEqual | test_recovery_when_server_closes_connection | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | b'Response 0') | added | bf777121c59d015650de19d9b713565b4b878c1ea2656c653eba2d54f2f0c676 | self.assertEqual|test_recovery_when_server_closes_connection|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ... | null | null | null |
urllib3/urllib3 | train | 292 | 791e9b4a97d71e6fccb11b4d1c67b01cc0848776 | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 848 | 8 | self.assertEqual | test_simple | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | sorted([ b'GET http://google.com/ HTTP/1.1', b'Host: google.com', b'Accept-Encoding: identity', b'Accept: */*', b'', b'', ])) | added | 0a6557469a253eeabbb925b77e3e1e7ef89b51f5f1a5ee779d9625981ed398e0 | self.assertEqual|test_simple|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( MaxRetryError, ProxyError, Rea... | null | null | null |
urllib3/urllib3 | train | 292 | 791e9b4a97d71e6fccb11b4d1c67b01cc0848776 | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 1,298 | 8 | self.assertEqual | test_request_headers_are_sent_in_the_original_order | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | actual_request_headers) | added | 054fb0f50856fe69efb98862ce932a69c4ee58bbb4505c36f4d43bb211d4f255 | self.assertEqual|test_request_headers_are_sent_in_the_original_order|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions... | null | null | null |
urllib3/urllib3 | train | 292 | 791e9b4a97d71e6fccb11b4d1c67b01cc0848776 | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 1,464 | 8 | self.assertEqual | test_empty_head_response_does_not_hang | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | list(r.stream())) | added | 485938b5eac1f5389398f76e1672cdb5da8165f576dc4e37367520176b2608c3 | self.assertEqual|test_empty_head_response_does_not_hang|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( Max... | null | null | null |
urllib3/urllib3 | train | 293 | 4325867d1ae0d139a11c8689c2d2a5ba2c666c83 | train | test/contrib/test_socks.py | train | urllib3/urllib3:test/contrib/test_socks.py | 458 | 12 | self.assertIn | test_socks_with_invalid_password | import threading
import socket
from urllib3.contrib import socks
from urllib3.exceptions import ConnectTimeoutError, NewConnectionError
from dummyserver.server import DEFAULT_CERTS, DEFAULT_CA
from dummyserver.testcase import IPV4SocketDummyServerTestCase
import pytest
try:
import ssl
from urllib3.util impo... | str(e)) | modified | 16dafcb15e7cf595eaf29317abeb26b236385af6385f49476810d18a289a3100 | self.assertIn|test_socks_with_invalid_password|import threading import socket from urllib3.contrib import socks from urllib3.exceptions import ConnectTimeoutError, NewConnectionError from dummyserver.server import DEFAULT_CERTS, DEFAULT_CA from dummyserver.testcase import IPV4SocketDummyServerTestCase import pytest try... | str(e)) | 458 | 12 |
urllib3/urllib3 | train | 293 | 4325867d1ae0d139a11c8689c2d2a5ba2c666c83 | train | test/test_connectionpool.py | train | urllib3/urllib3:test/test_connectionpool.py | 75 | 12 | assert | test_same_host | from __future__ import absolute_import
import ssl
import pytest
from urllib3.connectionpool import (
connection_from_url,
HTTPConnection,
HTTPConnectionPool,
HTTPSConnectionPool,
)
from urllib3.response import httplib, HTTPResponse
from urllib3.util.timeout import Timeout
from urllib3.packages.six.mov... | c.is_same_host(b) | modified | 4982115ce1fb48405650b3d029a6b0c6d564dc6fcce63b85970ba99a2ea1f550 | assert|test_same_host|from __future__ import absolute_import import ssl import pytest from urllib3.connectionpool import ( connection_from_url, HTTPConnection, HTTPConnectionPool, HTTPSConnectionPool, ) from urllib3.response import httplib, HTTPResponse from urllib3.util.timeout import Timeout from urllib3.packages.six... | c.is_same_host(b) | 74 | 12 |
urllib3/urllib3 | train | 293 | 4325867d1ae0d139a11c8689c2d2a5ba2c666c83 | train | test/test_connectionpool.py | train | urllib3/urllib3:test/test_connectionpool.py | 202 | 12 | assert | test_pool_edgecases | from __future__ import absolute_import
import ssl
import pytest
from urllib3.connectionpool import (
connection_from_url,
HTTPConnection,
HTTPConnectionPool,
HTTPSConnectionPool,
)
from urllib3.response import httplib, HTTPResponse
from urllib3.util.timeout import Timeout
from urllib3.packages.six.mov... | pool._get_conn() | modified | 56982da3aef8e5e21490fb32ca7e5be37518b961f9244c9fdc9b27b0679cda00 | assert|test_pool_edgecases|from __future__ import absolute_import import ssl import pytest from urllib3.connectionpool import ( connection_from_url, HTTPConnection, HTTPConnectionPool, HTTPSConnectionPool, ) from urllib3.response import httplib, HTTPResponse from urllib3.util.timeout import Timeout from urllib3.package... | pool._get_conn() | 201 | 12 |
urllib3/urllib3 | train | 293 | 4325867d1ae0d139a11c8689c2d2a5ba2c666c83 | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 508 | 8 | assert | test_is_fp_closed_object_has_none_fp | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | is_fp_closed(NoneFpFile()) | modified | 7d0e94e8f71c7f3fd2ffd716478623ff42548acfbb288ff2fa46c9f6ac0592dc | assert|test_is_fp_closed_object_has_none_fp|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewin... | is_fp_closed(NoneFpFile()) | 508 | 8 |
urllib3/urllib3 | train | 293 | 4325867d1ae0d139a11c8689c2d2a5ba2c666c83 | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 321 | 12 | self.assertTrue | test_unverified_ssl | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | warn.called) | added | 1721d32d678226e278c4451482a0e7f3cce0b85a431048f9ea582bdc313f0b3f | self.assertTrue|test_unverified_ssl|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_C... | null | null | null |
urllib3/urllib3 | train | 293 | 4325867d1ae0d139a11c8689c2d2a5ba2c666c83 | train | test/with_dummyserver/test_no_ssl.py | test | urllib3/urllib3:test/with_dummyserver/test_no_ssl.py | 29 | 12 | self.assertIn | test_simple | """
Test connections without the builtin ssl module
Note: Import urllib3 inside the test functions to get the importblocker to work
"""
from ..test_no_ssl import TestWithoutSSL
from dummyserver.testcase import (
HTTPDummyServerTestCase, HTTPSDummyServerTestCase)
import urllib3
class TestHTTPWithoutSSL(HTTP... | str(e)) | modified | 4d631cb2dde0c24e230da2367ac9535e325ab335c084ba1e3eeaf8abbd6495cc | self.assertIn|test_simple|""" Test connections without the builtin ssl module Note: Import urllib3 inside the test functions to get the importblocker to work """ from ..test_no_ssl import TestWithoutSSL from dummyserver.testcase import ( HTTPDummyServerTestCase, HTTPSDummyServerTestCase) import urllib3 class TestHTTPWi... | str(e)) | 29 | 12 |
urllib3/urllib3 | train | 293 | 4325867d1ae0d139a11c8689c2d2a5ba2c666c83 | train | test/with_dummyserver/test_proxy_poolmanager.py | train | urllib3/urllib3:test/with_dummyserver/test_proxy_poolmanager.py | 49 | 8 | self.assertEqual | test_nagle_proxy | import json
import socket
import unittest
import pytest
from dummyserver.testcase import HTTPDummyProxyTestCase, IPv6HTTPDummyProxyTestCase
from dummyserver.server import (
DEFAULT_CA, DEFAULT_CA_BAD, get_unreachable_address)
from .. import TARPIT_HOST, requires_network
from urllib3._collections import HTTPHeade... | "Expected TCP_NODELAY for proxies to be set " "to zero, instead was %s" % tcp_nodelay_setting) | modified | b07a896f5f5267c72ae9f9dc047825142b251802e1c0ae2a370d494ffee6b2f1 | self.assertEqual|test_nagle_proxy|import json import socket import unittest import pytest from dummyserver.testcase import HTTPDummyProxyTestCase, IPv6HTTPDummyProxyTestCase from dummyserver.server import ( DEFAULT_CA, DEFAULT_CA_BAD, get_unreachable_address) from .. import TARPIT_HOST, requires_network from urllib3._c... | "Expected TCP_NODELAY for proxies to be set " "to zero, instead was %s" % tcp_nodelay_setting) | 49 | 8 |
urllib3/urllib3 | train | 293 | 4325867d1ae0d139a11c8689c2d2a5ba2c666c83 | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 1,427 | 12 | assert | _test_okay_header_parsing | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | record.msg | modified | c0cd62ab89aa25a9a590a8b770246aa3c6a05092f927361d59f085d226bcc251 | assert|_test_okay_header_parsing|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( MaxRetryError, ProxyError,... | record.msg | 1,428 | 12 |
urllib3/urllib3 | train | 294 | 9eecb6bd0fab0a4546dd35c7ee42e8cd9c59274f | train | test/test_response.py | train | urllib3/urllib3:test/test_response.py | 130 | 8 | assert | test_chunked_decoding_deflate | import socket
import zlib
from io import BytesIO, BufferedReader
import pytest
import mock
from urllib3.response import HTTPResponse, brotli
from urllib3.exceptions import (
DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader
)
from urllib3.packages.six.moves import http_client as httplib
from urllib3.... | b'oo' | modified | ed94c61ce0e9bebc94b644ffdac907ba6e2e8bdc7ce1f411076e8a7a6b773fa5 | assert|test_chunked_decoding_deflate|import socket import zlib from io import BytesIO, BufferedReader import pytest import mock from urllib3.response import HTTPResponse, brotli from urllib3.exceptions import ( DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader ) from urllib3.packages.six.moves import http_c... | b'oo' | 128 | 8 |
urllib3/urllib3 | train | 294 | 9eecb6bd0fab0a4546dd35c7ee42e8cd9c59274f | train | test/test_response.py | train | urllib3/urllib3:test/test_response.py | 175 | 8 | assert | test_decode_gzip_multi_member | import socket
import zlib
from io import BytesIO, BufferedReader
import pytest
import mock
from urllib3.response import HTTPResponse, brotli
from urllib3.exceptions import (
DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader
)
from urllib3.packages.six.moves import http_client as httplib
from urllib3.... | b'foofoofoo' | modified | 7ba3f249ce8ba4ff1a3d4aecdb8d2119098c6f608535860781d8caba563a4697 | assert|test_decode_gzip_multi_member|import socket import zlib from io import BytesIO, BufferedReader import pytest import mock from urllib3.response import HTTPResponse, brotli from urllib3.exceptions import ( DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader ) from urllib3.packages.six.moves import http_c... | b'foofoofoo' | 173 | 8 |
urllib3/urllib3 | train | 294 | 9eecb6bd0fab0a4546dd35c7ee42e8cd9c59274f | train | test/test_response.py | train | urllib3/urllib3:test/test_response.py | 364 | 13 | pytest.raises | test_streaming | import socket
import zlib
from io import BytesIO, BufferedReader
import pytest
import mock
from urllib3.response import HTTPResponse, brotli
from urllib3.exceptions import (
DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader
)
from urllib3.packages.six.moves import http_client as httplib
from urllib3.... | StopIteration) | added | bfa7311c5de14446477b6019608c8b6af8ee71a2c3ddfd7a51fac0419a949b33 | pytest.raises|test_streaming|import socket import zlib from io import BytesIO, BufferedReader import pytest import mock from urllib3.response import HTTPResponse, brotli from urllib3.exceptions import ( DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader ) from urllib3.packages.six.moves import http_client as... | null | null | null |
urllib3/urllib3 | train | 294 | 9eecb6bd0fab0a4546dd35c7ee42e8cd9c59274f | train | test/test_response.py | train | urllib3/urllib3:test/test_response.py | 495 | 8 | assert | test_deflate2_streaming | import socket
import zlib
from io import BytesIO, BufferedReader
import pytest
import mock
from urllib3.response import HTTPResponse, brotli
from urllib3.exceptions import (
DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader
)
from urllib3.packages.six.moves import http_client as httplib
from urllib3.... | b'oo' | added | 6c9d0908ceba0827cbfe9fe25bc74c33057ac64e9cb6957f11cff1dabc5c997b | assert|test_deflate2_streaming|import socket import zlib from io import BytesIO, BufferedReader import pytest import mock from urllib3.response import HTTPResponse, brotli from urllib3.exceptions import ( DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader ) from urllib3.packages.six.moves import http_client ... | null | null | null |
urllib3/urllib3 | train | 294 | 9eecb6bd0fab0a4546dd35c7ee42e8cd9c59274f | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 131 | 13 | pytest.raises | test_invalid_host | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | LocationParseError) | modified | 76acbd49d92026e33978da50d11ce997582863be307856689aff67ae0ca6ef6d | pytest.raises|test_invalid_host|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAI... | LocationParseError) | 131 | 13 |
urllib3/urllib3 | train | 294 | 9eecb6bd0fab0a4546dd35c7ee42e8cd9c59274f | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 241 | 8 | assert | test_request_uri | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | expected_request_uri | modified | 9b3dc6c1719730fb8e0dca17aebd4c7797e327780d0efb2be63e30c5395e92fd | assert|test_request_uri|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL ... | expected_request_uri | 241 | 8 |
urllib3/urllib3 | train | 294 | 9eecb6bd0fab0a4546dd35c7ee42e8cd9c59274f | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 291 | 8 | assert | test_parse_url_unicode_python_2 | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | Url(u'https', host=u'www.google.com', path=u'/') | modified | 8331298c0cb25a4c8b189a3e62268bdcef73bc34a5d4b54832686e40bfde9f24 | assert|test_parse_url_unicode_python_2|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_bod... | Url(u'https', host=u'www.google.com', path=u'/') | 291 | 8 |
urllib3/urllib3 | train | 294 | 9eecb6bd0fab0a4546dd35c7ee42e8cd9c59274f | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 390 | 8 | assert | test_split_first | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | expected | added | 8a8691b8b7501b52dfbbeb43a41105de31f3805913b1813ee1e3787199c01215 | assert|test_split_first|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL ... | null | null | null |
urllib3/urllib3 | train | 295 | 1e9ab5aee042ff0158d0f443bc600ef3a2e7bf9a | train | test/contrib/test_pyopenssl.py | train | urllib3/urllib3:test/contrib/test_pyopenssl.py | 55 | 8 | self.assertEqual | test_dnsname_to_stdlib_simple | # -*- coding: utf-8 -*-
import os
import unittest
import mock
import pytest
try:
from urllib3.contrib.pyopenssl import (
_dnsname_to_stdlib, get_subj_alt_name
)
from cryptography import x509
from OpenSSL.crypto import FILETYPE_PEM, load_certificate
except ImportError:
pass
def setup_modu... | expected_result) | added | ab4a963b6b8ac72caab7d2b4e8e4fac7bbe5d2855217107156eefca2b140539d | self.assertEqual|test_dnsname_to_stdlib_simple|# -*- coding: utf-8 -*- import os import unittest import mock import pytest try: from urllib3.contrib.pyopenssl import ( _dnsname_to_stdlib, get_subj_alt_name ) from cryptography import x509 from OpenSSL.crypto import FILETYPE_PEM, load_certificate except ImportError: pass... | null | null | null |
urllib3/urllib3 | train | 295 | 1e9ab5aee042ff0158d0f443bc600ef3a2e7bf9a | train | test/contrib/test_pyopenssl.py | train | urllib3/urllib3:test/contrib/test_pyopenssl.py | 64 | 8 | self.assertEqual | test_dnsname_to_stdlib_leading_period | # -*- coding: utf-8 -*-
import os
import unittest
import mock
import pytest
try:
from urllib3.contrib.pyopenssl import (
_dnsname_to_stdlib, get_subj_alt_name
)
from cryptography import x509
from OpenSSL.crypto import FILETYPE_PEM, load_certificate
except ImportError:
pass
def setup_modu... | expected_result) | added | 03831526c4c8c8d494b21790a68b8ee061af7beff5fc706e9a8fcc03014de28a | self.assertEqual|test_dnsname_to_stdlib_leading_period|# -*- coding: utf-8 -*- import os import unittest import mock import pytest try: from urllib3.contrib.pyopenssl import ( _dnsname_to_stdlib, get_subj_alt_name ) from cryptography import x509 from OpenSSL.crypto import FILETYPE_PEM, load_certificate except ImportErr... | null | null | null |
urllib3/urllib3 | train | 295 | 1e9ab5aee042ff0158d0f443bc600ef3a2e7bf9a | train | test/contrib/test_pyopenssl.py | train | urllib3/urllib3:test/contrib/test_pyopenssl.py | 89 | 8 | self.assertIsInstance | test_get_subj_alt_name | # -*- coding: utf-8 -*-
import os
import unittest
import mock
import pytest
try:
from urllib3.contrib.pyopenssl import (
_dnsname_to_stdlib, get_subj_alt_name
)
from cryptography import x509
from OpenSSL.crypto import FILETYPE_PEM, load_certificate
except ImportError:
pass
def setup_modu... | x509.DuplicateExtension) | added | fb6f01921187fd8d1452040adb09295630b1edc2ce6e51e1f3f48990f2d841f0 | self.assertIsInstance|test_get_subj_alt_name|# -*- coding: utf-8 -*- import os import unittest import mock import pytest try: from urllib3.contrib.pyopenssl import ( _dnsname_to_stdlib, get_subj_alt_name ) from cryptography import x509 from OpenSSL.crypto import FILETYPE_PEM, load_certificate except ImportError: pass d... | null | null | null |
urllib3/urllib3 | train | 295 | 1e9ab5aee042ff0158d0f443bc600ef3a2e7bf9a | train | test/contrib/test_securetransport.py | train | urllib3/urllib3:test/contrib/test_securetransport.py | 42 | 13 | pytest.raises | test_no_crash_with_empty_trust_bundle | # -*- coding: utf-8 -*-
import contextlib
import socket
import ssl
import pytest
try:
from urllib3.contrib.securetransport import WrappedSocket
except ImportError:
pass
def setup_module():
try:
from urllib3.contrib.securetransport import inject_into_urllib3
inject_into_urllib3()
exce... | ssl.SSLError) | modified | 5aa8d1ed33b02723b180a9609a53b1e072144eb869b676fec38f9ed254dc12d2 | pytest.raises|test_no_crash_with_empty_trust_bundle|# -*- coding: utf-8 -*- import contextlib import socket import ssl import pytest try: from urllib3.contrib.securetransport import WrappedSocket except ImportError: pass def setup_module(): try: from urllib3.contrib.securetransport import inject_into_urllib3 inject_int... | ssl.SSLError) | 39 | 13 |
urllib3/urllib3 | train | 295 | 1e9ab5aee042ff0158d0f443bc600ef3a2e7bf9a | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 339 | 12 | self.assertIn | test_unverified_ssl | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | [x[0][1] for x in calls]) | added | 915aa1180ec8137943ad76bba96e37d8d0a717bd394bc98f6ed79837f92986ee | self.assertIn|test_unverified_ssl|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CER... | null | null | null |
urllib3/urllib3 | train | 295 | 1e9ab5aee042ff0158d0f443bc600ef3a2e7bf9a | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 629 | 8 | self.assertEqual | test_tls_protocol_name_of_socket | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | self.tls_protocol_name) | added | 18dc9f4e037c2b056e15b310c2119614e39f7c200b5a7f4ac7ef06d1436102df | self.assertEqual|test_tls_protocol_name_of_socket|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_... | null | null | null |
urllib3/urllib3 | train | 295 | 1e9ab5aee042ff0158d0f443bc600ef3a2e7bf9a | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 926 | 8 | self.assertRaises | test_retries | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | ProxyError) | modified | 435ef84b2e642ff3c0c12ded627a4833e3107f83220bbb46f0dbeea73c8da2d8 | self.assertRaises|test_retries|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( MaxRetryError, ProxyError, R... | ProxyError) | 926 | 8 |
urllib3/urllib3 | train | 295 | 1e9ab5aee042ff0158d0f443bc600ef3a2e7bf9a | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 1,136 | 13 | self.assertRaises | test_ssl_failed_fingerprint_verification | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | MaxRetryError) | modified | 50e4815112bd64175e9399a34e3c20cae631e9e85841e4ffeaff312c735b15cc | self.assertRaises|test_ssl_failed_fingerprint_verification|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( ... | MaxRetryError) | 1,136 | 13 |
urllib3/urllib3 | train | 296 | edfd3450c6ab8a9d6e1ecc441c665b0afd4084ba | train | test/with_dummyserver/test_connectionpool.py | train | urllib3/urllib3:test/with_dummyserver/test_connectionpool.py | 266 | 8 | self.assertEqual | test_upload | import io
import logging
import socket
import sys
import unittest
import time
import warnings
import pytest
import mock
from .. import (
TARPIT_HOST, VALID_SOURCE_ADDRESSES, INVALID_SOURCE_ADDRESSES,
)
from ..port_helpers import find_unused_port
from urllib3 import (
encode_multipart_formdata,
HTTPConnect... | r.data) | modified | 54e0fa6f218f32f84f88e85ba1c5b06b6f9f761350e069e6858f5d68239634dd | self.assertEqual|test_upload|import io import logging import socket import sys import unittest import time import warnings import pytest import mock from .. import ( TARPIT_HOST, VALID_SOURCE_ADDRESSES, INVALID_SOURCE_ADDRESSES, ) from ..port_helpers import find_unused_port from urllib3 import ( encode_multipart_formda... | r.data) | 264 | 8 |
urllib3/urllib3 | train | 296 | edfd3450c6ab8a9d6e1ecc441c665b0afd4084ba | train | test/with_dummyserver/test_connectionpool.py | train | urllib3/urllib3:test/with_dummyserver/test_connectionpool.py | 408 | 8 | self.assertFalse | test_tunnel | import io
import logging
import socket
import sys
import unittest
import time
import warnings
import pytest
import mock
from .. import (
TARPIT_HOST, VALID_SOURCE_ADDRESSES, INVALID_SOURCE_ADDRESSES,
)
from ..port_helpers import find_unused_port
from urllib3 import (
encode_multipart_formdata,
HTTPConnect... | conn._tunnel.called) | modified | 82bf2489711c7e0751041d46c9ff326d2bc68df81c48ba124e34fae9856cf779 | self.assertFalse|test_tunnel|import io import logging import socket import sys import unittest import time import warnings import pytest import mock from .. import ( TARPIT_HOST, VALID_SOURCE_ADDRESSES, INVALID_SOURCE_ADDRESSES, ) from ..port_helpers import find_unused_port from urllib3 import ( encode_multipart_formda... | conn._tunnel.called) | 406 | 8 |
urllib3/urllib3 | train | 296 | edfd3450c6ab8a9d6e1ecc441c665b0afd4084ba | train | test/with_dummyserver/test_connectionpool.py | train | urllib3/urllib3:test/with_dummyserver/test_connectionpool.py | 515 | 12 | self.assertEqual | test_post_with_multipart | import io
import logging
import socket
import sys
import unittest
import time
import warnings
import pytest
import mock
from .. import (
TARPIT_HOST, VALID_SOURCE_ADDRESSES, INVALID_SOURCE_ADDRESSES,
)
from ..port_helpers import find_unused_port
from urllib3 import (
encode_multipart_formdata,
HTTPConnect... | expected_body[i]) | modified | 98747375c313f844024649bb23a2ba959693e0c5f47c7aae968de19905b87e82 | self.assertEqual|test_post_with_multipart|import io import logging import socket import sys import unittest import time import warnings import pytest import mock from .. import ( TARPIT_HOST, VALID_SOURCE_ADDRESSES, INVALID_SOURCE_ADDRESSES, ) from ..port_helpers import find_unused_port from urllib3 import ( encode_mul... | expected_body[i]) | 513 | 12 |
urllib3/urllib3 | train | 296 | edfd3450c6ab8a9d6e1ecc441c665b0afd4084ba | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 551 | 8 | self.assertRaises | test_enhanced_timeout | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | ConnectTimeoutError) | modified | 0f7553908bf6190b157325f9fba37e2affd75ef1b1d6f37ba8461946a1ceef41 | self.assertRaises|test_enhanced_timeout|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAU... | ConnectTimeoutError) | 551 | 8 |
urllib3/urllib3 | train | 296 | edfd3450c6ab8a9d6e1ecc441c665b0afd4084ba | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 596 | 12 | self.assertEqual | test_ssl_wrong_system_time | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | warning.category) | modified | 570cc82a67235926118803b509df3b6e92ad51a401b8b0028d07c6957f2de270 | self.assertEqual|test_ssl_wrong_system_time|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, D... | warning.category) | 596 | 12 |
urllib3/urllib3 | train | 296 | edfd3450c6ab8a9d6e1ecc441c665b0afd4084ba | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 612 | 8 | self.assertEqual | test_set_ssl_version_to_tls_version | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import (
HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
)
from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS,
... | r.data) | modified | 0683f46e98eb59146024337005692401fd7f73b98cb956f63ef298bf3d99a562 | self.assertEqual|test_set_ssl_version_to_tls_version|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import ( HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase ) from dummyserver.server import (DEFAULT_CA, DEFAULT_... | r.data) | 612 | 8 |
urllib3/urllib3 | train | 296 | edfd3450c6ab8a9d6e1ecc441c665b0afd4084ba | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 492 | 12 | self.assertRaises | test_delayed_body_read_timeout | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | ReadTimeoutError) | modified | f4a0aebeb340962d23c3a47fc2d8087714877d3c3a6d37c04a4e0799c856b5db | self.assertRaises|test_delayed_body_read_timeout|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( MaxRetryEr... | ReadTimeoutError) | 492 | 12 |
urllib3/urllib3 | train | 296 | edfd3450c6ab8a9d6e1ecc441c665b0afd4084ba | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 1,140 | 8 | self.assertRaises | test_ssl_failed_fingerprint_verification | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | MaxRetryError) | modified | a991bc9231a6187f8338b4cf5064ed011340dc7cf947bdc99a2005d0729f05f9 | self.assertRaises|test_ssl_failed_fingerprint_verification|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( ... | MaxRetryError) | 1,140 | 8 |
urllib3/urllib3 | train | 297 | 46331f94275a4c3b4c71a358a495b1caeaececa0 | train | test/test_fields.py | train | urllib3/urllib3:test/test_fields.py | 31 | 8 | assert | test_make_multipart | import pytest
from urllib3.fields import format_header_param_rfc2231, guess_content_type, RequestField
from urllib3.packages.six import u
class TestRequestField(object):
@pytest.mark.parametrize('filename, content_types', [
('image.jpg', ['image/jpeg', 'image/pjpeg']),
('notsure', ['application/... | 'Content-Disposition: form-data; name="somename"\r\n' 'Content-Type: image/jpg\r\n' 'Content-Location: /test\r\n' '\r\n' | modified | a627da77ac1fb92e158a40d3a2a867b4cf127841af21ad3be45732337762047d | assert|test_make_multipart|import pytest from urllib3.fields import format_header_param_rfc2231, guess_content_type, RequestField from urllib3.packages.six import u class TestRequestField(object): @pytest.mark.parametrize('filename, content_types', [ ('image.jpg', ['image/jpeg', 'image/pjpeg']), ('notsure', ['applicati... | 'Content-Disposition: form-data; name="somename"\r\n' 'Content-Type: image/jpg\r\n' 'Content-Location: /test\r\n' '\r\n' | 32 | 8 |
urllib3/urllib3 | train | 297 | 46331f94275a4c3b4c71a358a495b1caeaececa0 | train | test/test_fields.py | train | urllib3/urllib3:test/test_fields.py | 58 | 8 | assert | test_render_part_rfc2231_unicode | import pytest
from urllib3.fields import format_header_param_rfc2231, guess_content_type, RequestField
from urllib3.packages.six import u
class TestRequestField(object):
@pytest.mark.parametrize('filename, content_types', [
('image.jpg', ['image/jpeg', 'image/pjpeg']),
('notsure', ['application/... | "filename*=utf-8''n%C3%A4me" | added | 35e0b89587fd2251b0c82c6a35607d9b7500627cefc6bce6594312af01fa8e77 | assert|test_render_part_rfc2231_unicode|import pytest from urllib3.fields import format_header_param_rfc2231, guess_content_type, RequestField from urllib3.packages.six import u class TestRequestField(object): @pytest.mark.parametrize('filename, content_types', [ ('image.jpg', ['image/jpeg', 'image/pjpeg']), ('notsure'... | null | null | null |
urllib3/urllib3 | train | 297 | 46331f94275a4c3b4c71a358a495b1caeaececa0 | train | test/test_fields.py | train | urllib3/urllib3:test/test_fields.py | 63 | 8 | assert | test_render_part_rfc2231_ascii | import pytest
from urllib3.fields import format_header_param_rfc2231, guess_content_type, RequestField
from urllib3.packages.six import u
class TestRequestField(object):
@pytest.mark.parametrize('filename, content_types', [
('image.jpg', ['image/jpeg', 'image/pjpeg']),
('notsure', ['application/... | 'filename="name"' | added | 7d82f958a69635a3556586629a46e91a5c044994b38dad401dc2ac86638082f5 | assert|test_render_part_rfc2231_ascii|import pytest from urllib3.fields import format_header_param_rfc2231, guess_content_type, RequestField from urllib3.packages.six import u class TestRequestField(object): @pytest.mark.parametrize('filename, content_types', [ ('image.jpg', ['image/jpeg', 'image/pjpeg']), ('notsure', ... | null | null | null |
urllib3/urllib3 | train | 297 | 46331f94275a4c3b4c71a358a495b1caeaececa0 | train | test/test_fields.py | train | urllib3/urllib3:test/test_fields.py | 78 | 8 | assert | test_render_part_html5_unicode_escape | import pytest
from urllib3.fields import format_header_param_rfc2231, guess_content_type, RequestField
from urllib3.packages.six import u
class TestRequestField(object):
@pytest.mark.parametrize('filename, content_types', [
('image.jpg', ['image/jpeg', 'image/pjpeg']),
('notsure', ['application/... | u('filename="hello\\\\world%22"') | added | 8d69e5901bd3bb9a21c7edeb54fa733750fffc64b8e572265bc66ecdeb64cad8 | assert|test_render_part_html5_unicode_escape|import pytest from urllib3.fields import format_header_param_rfc2231, guess_content_type, RequestField from urllib3.packages.six import u class TestRequestField(object): @pytest.mark.parametrize('filename, content_types', [ ('image.jpg', ['image/jpeg', 'image/pjpeg']), ('not... | null | null | null |
urllib3/urllib3 | train | 299 | 5d523706c7b03f947dc50a7e783758a2bfff0532 | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 142 | 13 | pytest.raises | test_invalid_url | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | LocationParseError) | added | 8635ffbaaf5a303dff29e58e2e3398eca58fcdba23298a8190f954583c535888 | pytest.raises|test_invalid_url|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAIL... | null | null | null |
urllib3/urllib3 | train | 299 | 5d523706c7b03f947dc50a7e783758a2bfff0532 | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 222 | 8 | assert | test_parse_url | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | expected_url | added | fb912f6ada6b362ebb55a4102a67d077910bda37e62564bc0147a965365a04aa | assert|test_parse_url|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL fr... | null | null | null |
urllib3/urllib3 | train | 299 | 5d523706c7b03f947dc50a7e783758a2bfff0532 | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 272 | 8 | assert | test_request_uri | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | expected_request_uri | added | ab7db88f393f58cca9643ba58c22483ab49e49561016a09d4e82d12163bf071f | assert|test_request_uri|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL ... | null | null | null |
urllib3/urllib3 | train | 299 | 5d523706c7b03f947dc50a7e783758a2bfff0532 | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 673 | 16 | assert | test_has_ipv6_enabled_but_fails | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | not _has_ipv6('::1') | added | c67d29e370437efeb48512be6825d84e2f21194e3843184a0c32b4f88d9e9ccd | assert|test_has_ipv6_enabled_but_fails|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_bod... | null | null | null |
urllib3/urllib3 | train | 300 | bbeeae20cc9af5f9c833da8d35a95a42fad8393e | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 276 | 8 | assert | test_request_uri | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | expected_request_uri | added | 4c224043241421e4b622661d14098841c01281739702eb36abb09c9e224707c0 | assert|test_request_uri|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL ... | null | null | null |
urllib3/urllib3 | train | 300 | bbeeae20cc9af5f9c833da8d35a95a42fad8393e | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 616 | 8 | assert_* | test_ssl_wrap_socket_creates_new_context | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | 'CERT_REQUIRED') | added | 871394ba904d1f9d8beb85211f963c7fcc667cfa73e9ae845f34d6a921bb3f21 | assert_*|test_ssl_wrap_socket_creates_new_context|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers,... | null | null | null |
urllib3/urllib3 | train | 300 | bbeeae20cc9af5f9c833da8d35a95a42fad8393e | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 634 | 8 | assert_* | test_ssl_wrap_socket_loads_certificate_directories | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | '/path/to/pems') | added | c88a3b90488dc3137ca6c73ee77da2756b9d9227731f3db5c8654e15824a1476 | assert_*|test_ssl_wrap_socket_loads_certificate_directories|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import mak... | null | null | null |
urllib3/urllib3 | train | 300 | bbeeae20cc9af5f9c833da8d35a95a42fad8393e | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 663 | 8 | assert | test_const_compare_digest_fallback | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | not _const_compare_digest_backport(target, suffix) | modified | 5061d08d41dfb217239c8f37bc7a503ea44e83413e04dd7441f5ae1d4526896e | assert|test_const_compare_digest_fallback|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_... | not _const_compare_digest_backport(target, incorrect) | 662 | 8 |
urllib3/urllib3 | train | 301 | a0d2bfd6098fe996fca74b80cbe473236187157c | train | test/test_ssl.py | train | urllib3/urllib3:test/test_ssl.py | 25 | 4 | assert | test_is_ipaddress_true | import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize('addr', [
# IPv6
'::1',
'::',
'FE80::8939:7684:D84b:a5A4%251',
# IPv4
'127.0.0.1',
'8.8.8.8',
b'127.0.0.1',
# IPv6 w/ Zone IDs
'FE80::8939:7684:D8... | ssl_.is_ipaddress(addr) | added | 87c2a8c8ccc9e5eacd89c15bac7b07c0efc755129725972a957a871d3052f2fb | assert|test_is_ipaddress_true|import mock import pytest from urllib3.util import ssl_ from urllib3.exceptions import SNIMissingWarning @pytest.mark.parametrize('addr', [ # IPv6 '::1', '::', 'FE80::8939:7684:D84b:a5A4%251', # IPv4 '127.0.0.1', '8.8.8.8', b'127.0.0.1', # IPv6 w/ Zone IDs 'FE80::8939:7684:D84b:a5A4%251', ... | null | null | null |
urllib3/urllib3 | train | 301 | a0d2bfd6098fe996fca74b80cbe473236187157c | train | test/test_ssl.py | train | urllib3/urllib3:test/test_ssl.py | 35 | 4 | assert | test_is_ipaddress_false | import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize('addr', [
# IPv6
'::1',
'::',
'FE80::8939:7684:D84b:a5A4%251',
# IPv4
'127.0.0.1',
'8.8.8.8',
b'127.0.0.1',
# IPv6 w/ Zone IDs
'FE80::8939:7684:D8... | not ssl_.is_ipaddress(addr) | added | b5ee0af8de454e53415a63adf22c6089759e6b1524a13ede0b64048b63c4e431 | assert|test_is_ipaddress_false|import mock import pytest from urllib3.util import ssl_ from urllib3.exceptions import SNIMissingWarning @pytest.mark.parametrize('addr', [ # IPv6 '::1', '::', 'FE80::8939:7684:D84b:a5A4%251', # IPv4 '127.0.0.1', '8.8.8.8', b'127.0.0.1', # IPv6 w/ Zone IDs 'FE80::8939:7684:D84b:a5A4%251',... | null | null | null |
urllib3/urllib3 | train | 301 | a0d2bfd6098fe996fca74b80cbe473236187157c | train | test/test_ssl.py | train | urllib3/urllib3:test/test_ssl.py | 82 | 8 | assert | test_sni_missing_warning_with_ip_addresses | import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize('addr', [
# IPv6
'::1',
'::',
'FE80::8939:7684:D84b:a5A4%251',
# IPv4
'127.0.0.1',
'8.8.8.8',
b'127.0.0.1',
# IPv6 w/ Zone IDs
'FE80::8939:7684:D8... | warnings | added | ac9d01ef53e1be3824a59ae47b2b21ae970f282e6e70e86cd30b355decbe2473 | assert|test_sni_missing_warning_with_ip_addresses|import mock import pytest from urllib3.util import ssl_ from urllib3.exceptions import SNIMissingWarning @pytest.mark.parametrize('addr', [ # IPv6 '::1', '::', 'FE80::8939:7684:D84b:a5A4%251', # IPv4 '127.0.0.1', '8.8.8.8', b'127.0.0.1', # IPv6 w/ Zone IDs 'FE80::8939:7... | null | null | null |
urllib3/urllib3 | train | 301 | a0d2bfd6098fe996fca74b80cbe473236187157c | train | test/test_ssl.py | train | urllib3/urllib3:test/test_ssl.py | 102 | 4 | assert | test_create_urllib3_context_set_ciphers | import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize('addr', [
# IPv6
'::1',
'::',
'FE80::8939:7684:D84b:a5A4%251',
# IPv4
'127.0.0.1',
'8.8.8.8',
b'127.0.0.1',
# IPv6 w/ Zone IDs
'FE80::8939:7684:D8... | mock.call(expected_ciphers) | added | cac357e4efbc9f64e5fdaa2a5c6fbb1edb410fa1bd56f0a0a1133cec2b4076e9 | assert|test_create_urllib3_context_set_ciphers|import mock import pytest from urllib3.util import ssl_ from urllib3.exceptions import SNIMissingWarning @pytest.mark.parametrize('addr', [ # IPv6 '::1', '::', 'FE80::8939:7684:D84b:a5A4%251', # IPv4 '127.0.0.1', '8.8.8.8', b'127.0.0.1', # IPv6 w/ Zone IDs 'FE80::8939:7684... | null | null | null |
urllib3/urllib3 | train | 302 | a74c9cfbaed9f811e7563cfc3dce894928e0221a | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 253 | 8 | assert | test_unparse_url | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | expected_url.url | added | abd5de5475deb4697793c9885cb9533fc891f88487c714393fcdb3a6d90a354e | assert|test_unparse_url|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL ... | null | null | null |
urllib3/urllib3 | train | 302 | a74c9cfbaed9f811e7563cfc3dce894928e0221a | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 310 | 8 | assert | test_netloc | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | expected_netloc | added | 5f81cc8e7e3f1f2cab4fa9993ef980e0f45ed8f8a7e473a4864a493d663b52f5 | assert|test_netloc|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL from ... | null | null | null |
urllib3/urllib3 | train | 302 | a74c9cfbaed9f811e7563cfc3dce894928e0221a | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 432 | 8 | assert | test_rewind_body | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | b'data' | added | f4063abca3c6b30900bb977562217193d6b122b74666acb120c9a51b6b2d3909 | assert|test_rewind_body|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL ... | null | null | null |
urllib3/urllib3 | train | 302 | a74c9cfbaed9f811e7563cfc3dce894928e0221a | train | test/test_util.py | train | urllib3/urllib3:test/test_util.py | 620 | 13 | pytest.raises | test_is_fp_closed_object_has_neither_fp_nor_closed | # coding: utf-8
import hashlib
import warnings
import logging
import io
import ssl
import socket
from itertools import chain
from mock import patch, Mock
import pytest
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers, rewind_body, _FAILEDTELL
from urllib3.util.resp... | ValueError) | added | b1b96c064bc6514ebd5675293ae4e697c9ab4551e4943ff4560481271b283d38 | pytest.raises|test_is_fp_closed_object_has_neither_fp_nor_closed|# coding: utf-8 import hashlib import warnings import logging import io import ssl import socket from itertools import chain from mock import patch, Mock import pytest from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request impor... | null | null | null |
urllib3/urllib3 | train | 303 | 42bacbca876461ae8a5ec993992b7f84e27b693d | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 66 | 8 | self.assertEqual | test_multi_setcookie | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | ['foo=1', 'bar=1']) | modified | 83e8152e3bf6bc6e8d69ee95d676bc022c78a03c9f2ea9b0387e522a707ca510 | self.assertEqual|test_multi_setcookie|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( MaxRetryError, ProxyE... | ['foo=1', 'bar=1']) | 65 | 8 |
urllib3/urllib3 | train | 303 | 42bacbca876461ae8a5ec993992b7f84e27b693d | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 352 | 8 | self.assertEqual | test_recovery_when_server_closes_connection | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | b'Response 1') | modified | a97d651dd60ee0bef0665a94e8157ab1c9c52ca85f5c19e829c73c55b0aade12 | self.assertEqual|test_recovery_when_server_closes_connection|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ... | b'Response 1') | 351 | 8 |
urllib3/urllib3 | train | 303 | 42bacbca876461ae8a5ec993992b7f84e27b693d | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 1,099 | 12 | self.assertRaises | test_ssl_read_timeout | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | ReadTimeoutError) | modified | cd3411621025468644ff9825c030b3ff2301e8e9a8422d0fc32df07535f1bf59 | self.assertRaises|test_ssl_read_timeout|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( MaxRetryError, Prox... | ReadTimeoutError) | 1,098 | 12 |
urllib3/urllib3 | train | 303 | 42bacbca876461ae8a5ec993992b7f84e27b693d | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 1,302 | 8 | self.assertEqual | test_httplib_headers_case_insensitive | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTim... | dict(r.headers.items())) | added | 60a058377e3453592ade9677e503ac9e6a65e810c32e4f0179bc660e53c457ba | self.assertEqual|test_httplib_headers_case_insensitive|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( MaxR... | null | null | null |
urllib3/urllib3 | train | 304 | f7a4bed04085975918b3469bf94e195df9faf29a | train | test/appengine/test_gae_manager.py | test | urllib3/urllib3:test/appengine/test_gae_manager.py | 48 | 8 | self.assertRaises | test_exceptions | import dummyserver.testcase
import pytest
from urllib3.contrib import appengine
import urllib3.exceptions
import urllib3.util.url
import urllib3.util.retry
from test.with_dummyserver import test_connectionpool
# This class is used so we can re-use the tests from the connection pool.
# It proxies all requests to the... | urllib3.exceptions.TimeoutError) | modified | bbfa27d89981aecf021bd4c078f81caf85c9210341825ec9002d0743a5598638 | self.assertRaises|test_exceptions|import dummyserver.testcase import pytest from urllib3.contrib import appengine import urllib3.exceptions import urllib3.util.url import urllib3.util.retry from test.with_dummyserver import test_connectionpool # This class is used so we can re-use the tests from the connection pool. # ... | urllib3.exceptions.TimeoutError) | 51 | 8 |
urllib3/urllib3 | train | 304 | f7a4bed04085975918b3469bf94e195df9faf29a | train | test/contrib/test_pyopenssl.py | train | urllib3/urllib3:test/contrib/test_pyopenssl.py | 98 | 8 | self.assertIsInstance | test_get_subj_alt_name | # -*- coding: utf-8 -*-
import os
import unittest
import mock
import pytest
try:
from urllib3.contrib.pyopenssl import _dnsname_to_stdlib, get_subj_alt_name
from cryptography import x509
from OpenSSL.crypto import FILETYPE_PEM, load_certificate
except ImportError:
pass
def setup_module():
try:
... | x509.DuplicateExtension) | added | 896d93d7299e2dcea957bb2c82bb223b6e03d0bd252f6e11b465a82a9e51f698 | self.assertIsInstance|test_get_subj_alt_name|# -*- coding: utf-8 -*- import os import unittest import mock import pytest try: from urllib3.contrib.pyopenssl import _dnsname_to_stdlib, get_subj_alt_name from cryptography import x509 from OpenSSL.crypto import FILETYPE_PEM, load_certificate except ImportError: pass def s... | null | null | null |
urllib3/urllib3 | train | 304 | f7a4bed04085975918b3469bf94e195df9faf29a | train | test/contrib/test_securetransport.py | train | urllib3/urllib3:test/contrib/test_securetransport.py | 49 | 13 | pytest.raises | test_no_crash_with_empty_trust_bundle | # -*- coding: utf-8 -*-
import contextlib
import socket
import ssl
import pytest
try:
from urllib3.contrib.securetransport import WrappedSocket
except ImportError:
pass
def setup_module():
try:
from urllib3.contrib.securetransport import inject_into_urllib3
inject_into_urllib3()
exc... | ssl.SSLError) | added | 9d9949af67df3c169e06fea12203cf654cf6d71afe3953b846b6e0491b397e6b | pytest.raises|test_no_crash_with_empty_trust_bundle|# -*- coding: utf-8 -*- import contextlib import socket import ssl import pytest try: from urllib3.contrib.securetransport import WrappedSocket except ImportError: pass def setup_module(): try: from urllib3.contrib.securetransport import inject_into_urllib3 inject_int... | null | null | null |
urllib3/urllib3 | train | 304 | f7a4bed04085975918b3469bf94e195df9faf29a | train | test/test_connection.py | test | urllib3/urllib3:test/test_connection.py | 23 | 13 | pytest.raises | test_match_hostname_empty_cert | import datetime
import mock
import pytest
from urllib3.connection import CertificateError, _match_hostname, RECENT_DATE
class TestConnection(object):
"""
Tests in this suite should not make any network requests or connections.
"""
def test_match_hostname_no_cert(self):
cert = None
a... | ValueError) | modified | 90c0d1945aba315a1e1303fc3ec9607681504267a33cff97f2e211dbe2b264e4 | pytest.raises|test_match_hostname_empty_cert|import datetime import mock import pytest from urllib3.connection import CertificateError, _match_hostname, RECENT_DATE class TestConnection(object): """ Tests in this suite should not make any network requests or connections. """ def test_match_hostname_no_cert(self): cert ... | ValueError) | 26 | 13 |
urllib3/urllib3 | train | 304 | f7a4bed04085975918b3469bf94e195df9faf29a | train | test/test_exceptions.py | val | urllib3/urllib3:test/test_exceptions.py | 47 | 8 | assert | test_header_parsing_errors | import pickle
import pytest
from urllib3.exceptions import (
HTTPError,
MaxRetryError,
LocationParseError,
ClosedPoolError,
EmptyPoolError,
HostChangedError,
ReadTimeoutError,
ConnectTimeoutError,
HeaderParsingError,
)
from urllib3.connectionpool import HTTPConnectionPool
class T... | str(hpe) | added | bdaf728ea844ebcefc8bf4019eeb0bbd6c075d10cf8c53d51f41cff3cdd5d4ec | assert|test_header_parsing_errors|import pickle import pytest from urllib3.exceptions import ( HTTPError, MaxRetryError, LocationParseError, ClosedPoolError, EmptyPoolError, HostChangedError, ReadTimeoutError, ConnectTimeoutError, HeaderParsingError, ) from urllib3.connectionpool import HTTPConnectionPool class TestPic... | null | null | null |
urllib3/urllib3 | train | 304 | f7a4bed04085975918b3469bf94e195df9faf29a | train | test/test_queue_monkeypatch.py | train | urllib3/urllib3:test/test_queue_monkeypatch.py | 30 | 21 | pytest.raises | test_queue_monkeypatching | from __future__ import absolute_import
import mock
import pytest
from urllib3 import HTTPConnectionPool
from urllib3.exceptions import EmptyPoolError
from urllib3.packages.six.moves import queue
class BadError(Exception):
"""
This should not be raised.
"""
pass
class TestMonkeypatchResistance(ob... | EmptyPoolError) | modified | d9ee1bc065d865fcf0839a9945b2772315a5ae20fb68f9d6485f39f93ceb8c4e | pytest.raises|test_queue_monkeypatching|from __future__ import absolute_import import mock import pytest from urllib3 import HTTPConnectionPool from urllib3.exceptions import EmptyPoolError from urllib3.packages.six.moves import queue class BadError(Exception): """ This should not be raised. """ pass class TestMonkeypa... | EmptyPoolError) | 28 | 21 |
urllib3/urllib3 | train | 304 | f7a4bed04085975918b3469bf94e195df9faf29a | train | test/test_response.py | train | urllib3/urllib3:test/test_response.py | 680 | 13 | pytest.raises | test_read_not_chunked_response_as_chunks | import socket
import zlib
from io import BytesIO, BufferedReader
import pytest
import mock
from urllib3.response import HTTPResponse, brotli
from urllib3.exceptions import (
DecodeError,
ResponseNotChunked,
ProtocolError,
InvalidHeader,
)
from urllib3.packages.six.moves import http_client as httplib
... | ResponseNotChunked) | added | e0973f1507c832bec89026829895db109d2021af92bfa28f8ee7f74faae7065d | pytest.raises|test_read_not_chunked_response_as_chunks|import socket import zlib from io import BytesIO, BufferedReader import pytest import mock from urllib3.response import HTTPResponse, brotli from urllib3.exceptions import ( DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader, ) from urllib3.packages.six.... | null | null | null |
urllib3/urllib3 | train | 304 | f7a4bed04085975918b3469bf94e195df9faf29a | train | test/with_dummyserver/test_poolmanager.py | train | urllib3/urllib3:test/with_dummyserver/test_poolmanager.py | 113 | 8 | self.assertEqual | test_cross_host_redirect | import unittest
import json
import pytest
from dummyserver.server import HAS_IPV6
from dummyserver.testcase import HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase
from urllib3.poolmanager import PoolManager
from urllib3.connectionpool import port_by_scheme
from urllib3.exceptions import MaxRetryError
from urllib... | self.host_alt) | added | 13b9312a638c9c39ca845c0e1df9a601813b220a031696f7a7f7742d1e9cefec | self.assertEqual|test_cross_host_redirect|import unittest import json import pytest from dummyserver.server import HAS_IPV6 from dummyserver.testcase import HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase from urllib3.poolmanager import PoolManager from urllib3.connectionpool import port_by_scheme from urllib3.exc... | null | null | null |
urllib3/urllib3 | train | 305 | 52c827532d8b434e6bd344fad7ee69b9d247792b | train | test/appengine/test_gae_manager.py | test | urllib3/urllib3:test/appengine/test_gae_manager.py | 68 | 13 | pytest.raises | test_exceptions | import dummyserver.testcase
import pytest
from urllib3.contrib import appengine
import urllib3.exceptions
import urllib3.util.url
import urllib3.util.retry
from test.with_dummyserver import test_connectionpool
# This class is used so we can re-use the tests from the connection pool.
# It proxies all requests to the... | appengine.AppEnginePlatformError) | added | 1a859ec0afbc8cbcc4f601ab8740de2b8b629a72bc2af724d0a1e75c23243105 | pytest.raises|test_exceptions|import dummyserver.testcase import pytest from urllib3.contrib import appengine import urllib3.exceptions import urllib3.util.url import urllib3.util.retry from test.with_dummyserver import test_connectionpool # This class is used so we can re-use the tests from the connection pool. # It p... | null | null | null |
urllib3/urllib3 | train | 305 | 52c827532d8b434e6bd344fad7ee69b9d247792b | train | test/contrib/test_pyopenssl_dependencies.py | train | urllib3/urllib3:test/contrib/test_pyopenssl_dependencies.py | 59 | 21 | pytest.raises | test_inject_validate_fail_pyopenssl | # -*- coding: utf-8 -*-
import unittest
import pytest
from mock import patch, Mock
try:
from urllib3.contrib.pyopenssl import inject_into_urllib3, extract_from_urllib3
except ImportError:
pass
def setup_module():
try:
from urllib3.contrib.pyopenssl import inject_into_urllib3
inject_into... | ImportError) | added | 9289dde0a60cfe45ec8ef02eafeffbae9abf885b4ed495404822f453798e926f | pytest.raises|test_inject_validate_fail_pyopenssl|# -*- coding: utf-8 -*- import unittest import pytest from mock import patch, Mock try: from urllib3.contrib.pyopenssl import inject_into_urllib3, extract_from_urllib3 except ImportError: pass def setup_module(): try: from urllib3.contrib.pyopenssl import inject_into_ur... | null | null | null |
urllib3/urllib3 | train | 305 | 52c827532d8b434e6bd344fad7ee69b9d247792b | train | test/test_no_ssl.py | train | urllib3/urllib3:test/test_no_ssl.py | 82 | 13 | pytest.raises | test_cannot_import_ssl | """
Test what happens if Python was built without SSL
* Everything that does not involve HTTPS should still work
* HTTPS requests must fail with an error that points at the ssl module
"""
import sys
import unittest
import pytest
class ImportBlocker(object):
"""
Block Imports
To be placed on ``sys.meta_... | ImportError) | added | 5ed2e61382095be8e7ec384924da9c72ed1964feb8f9e129460c7690891b97ca | pytest.raises|test_cannot_import_ssl|""" Test what happens if Python was built without SSL * Everything that does not involve HTTPS should still work * HTTPS requests must fail with an error that points at the ssl module """ import sys import unittest import pytest class ImportBlocker(object): """ Block Imports To be p... | null | null | null |
urllib3/urllib3 | train | 305 | 52c827532d8b434e6bd344fad7ee69b9d247792b | train | test/with_dummyserver/test_chunked_transfer.py | train | urllib3/urllib3:test/with_dummyserver/test_chunked_transfer.py | 54 | 12 | assert | _test_body | # -*- coding: utf-8 -*-
from urllib3 import HTTPConnectionPool
from dummyserver.testcase import SocketDummyServerTestCase
class TestChunkedTransfer(SocketDummyServerTestCase):
def start_chunked_handler(self):
self.buffer = b""
def socket_handler(listener):
sock = listener.accept()[0]... | body | added | 4c98d4f8bfa1d0a7d6a1e4189fc0f5758c5ade1f241ae998cbb0d23656e86919 | assert|_test_body|# -*- coding: utf-8 -*- from urllib3 import HTTPConnectionPool from dummyserver.testcase import SocketDummyServerTestCase class TestChunkedTransfer(SocketDummyServerTestCase): def start_chunked_handler(self): self.buffer = b"" def socket_handler(listener): sock = listener.accept()[0] while not self.bu... | null | null | null |
urllib3/urllib3 | train | 305 | 52c827532d8b434e6bd344fad7ee69b9d247792b | train | test/with_dummyserver/test_https.py | train | urllib3/urllib3:test/with_dummyserver/test_https.py | 384 | 12 | assert | test_ssl_unverified_with_ca_certs | import datetime
import json
import logging
import ssl
import sys
import unittest
import warnings
import mock
import pytest
from dummyserver.testcase import HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
from dummyserver.server import (
DEFAULT_CA,
DEFAULT_CA_BAD,
DEFAULT_CERTS,
DEFAULT_CLIENT_... | warn.called | added | 823153fb8015c8064ba3fd0d21b1ac9e7456f487388e96d2fc967a31050f7f32 | assert|test_ssl_unverified_with_ca_certs|import datetime import json import logging import ssl import sys import unittest import warnings import mock import pytest from dummyserver.testcase import HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase from dummyserver.server import ( DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT... | null | null | null |
urllib3/urllib3 | train | 305 | 52c827532d8b434e6bd344fad7ee69b9d247792b | train | test/with_dummyserver/test_poolmanager.py | train | urllib3/urllib3:test/with_dummyserver/test_poolmanager.py | 83 | 8 | assert | test_redirect_to_relative_url | import unittest
import json
import pytest
from dummyserver.server import HAS_IPV6
from dummyserver.testcase import HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase
from urllib3.poolmanager import PoolManager
from urllib3.connectionpool import port_by_scheme
from urllib3.exceptions import MaxRetryError
from urllib... | b"Dummy server!" | added | c6d24f3329f8f9c916b3948775431cfd13fb9a38ad2ec09b1144731fb3ab9519 | assert|test_redirect_to_relative_url|import unittest import json import pytest from dummyserver.server import HAS_IPV6 from dummyserver.testcase import HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase from urllib3.poolmanager import PoolManager from urllib3.connectionpool import port_by_scheme from urllib3.exceptio... | null | null | null |
urllib3/urllib3 | train | 305 | 52c827532d8b434e6bd344fad7ee69b9d247792b | train | test/with_dummyserver/test_proxy_poolmanager.py | train | urllib3/urllib3:test/with_dummyserver/test_proxy_poolmanager.py | 357 | 12 | assert | test_https_proxy_pool_timeout | import json
import socket
import unittest
import pytest
from dummyserver.testcase import HTTPDummyProxyTestCase, IPv6HTTPDummyProxyTestCase
from dummyserver.server import DEFAULT_CA, DEFAULT_CA_BAD, get_unreachable_address
from .. import TARPIT_HOST, requires_network
from urllib3._collections import HTTPHeaderDict
f... | ConnectTimeoutError | added | 686a0dbbd2ab1f0be8903ffe233313291d9d31415baa961d3722a709c50cc335 | assert|test_https_proxy_pool_timeout|import json import socket import unittest import pytest from dummyserver.testcase import HTTPDummyProxyTestCase, IPv6HTTPDummyProxyTestCase from dummyserver.server import DEFAULT_CA, DEFAULT_CA_BAD, get_unreachable_address from .. import TARPIT_HOST, requires_network from urllib3._c... | null | null | null |
urllib3/urllib3 | train | 305 | 52c827532d8b434e6bd344fad7ee69b9d247792b | train | test/with_dummyserver/test_socketlevel.py | train | urllib3/urllib3:test/with_dummyserver/test_socketlevel.py | 1,489 | 8 | assert | test_headers_are_sent_with_the_original_case | # TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.poolmanager import proxy_from_url
from urllib3.exceptions import (
MaxRetryError,
ProxyError,
ReadTimeoutError,
... | parsed_headers | added | 16722659209b02871da5e6c4bddf30da9047d1a5e073f980bac72dcf3cc28147 | assert|test_headers_are_sent_with_the_original_case|# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( MaxRetr... | null | null | null |
urllib3/urllib3 | train | 306 | f6d5b4b8da14630acc86633bbfd0757603f07edd | train | test/test_response.py | train | urllib3/urllib3:test/test_response.py | 552 | 8 | assert | test_length_when_chunked | import socket
import zlib
from io import BytesIO, BufferedReader
import pytest
import mock
from urllib3.response import HTTPResponse, brotli
from urllib3.exceptions import (
DecodeError,
ResponseNotChunked,
ProtocolError,
InvalidHeader,
)
from urllib3.packages.six.moves import http_client as httplib
... | None | modified | a70ebea3d7baab26b468a25a317925f9662f530440209a42bf6287e945c08379 | assert|test_length_when_chunked|import socket import zlib from io import BytesIO, BufferedReader import pytest import mock from urllib3.response import HTTPResponse, brotli from urllib3.exceptions import ( DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader, ) from urllib3.packages.six.moves import http_clien... | None | 552 | 8 |
urllib3/urllib3 | train | 306 | f6d5b4b8da14630acc86633bbfd0757603f07edd | train | test/test_response.py | train | urllib3/urllib3:test/test_response.py | 648 | 8 | assert | test_mock_gzipped_transfer_encoding_chunked_decoded | import socket
import zlib
from io import BytesIO, BufferedReader
import pytest
import mock
from urllib3.response import HTTPResponse, brotli
from urllib3.exceptions import (
DecodeError,
ResponseNotChunked,
ProtocolError,
InvalidHeader,
)
from urllib3.packages.six.moves import http_client as httplib
... | data | modified | 1ac9dcd952fd9e3a9babab73233fe23bc169c11f1da8c5a9440fed5178bc5943 | assert|test_mock_gzipped_transfer_encoding_chunked_decoded|import socket import zlib from io import BytesIO, BufferedReader import pytest import mock from urllib3.response import HTTPResponse, brotli from urllib3.exceptions import ( DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader, ) from urllib3.packages.... | data | 648 | 8 |
urllib3/urllib3 | train | 306 | f6d5b4b8da14630acc86633bbfd0757603f07edd | train | test/test_response.py | train | urllib3/urllib3:test/test_response.py | 706 | 8 | assert | test_chunked_response_without_crlf_on_end | import socket
import zlib
from io import BytesIO, BufferedReader
import pytest
import mock
from urllib3.response import HTTPResponse, brotli
from urllib3.exceptions import (
DecodeError,
ResponseNotChunked,
ProtocolError,
InvalidHeader,
)
from urllib3.packages.six.moves import http_client as httplib
... | list(resp.stream()) | modified | b1289224eb01765a6af964dc18dc5b15aac7942b8d875b307dc5cebbbcc7cb02 | assert|test_chunked_response_without_crlf_on_end|import socket import zlib from io import BytesIO, BufferedReader import pytest import mock from urllib3.response import HTTPResponse, brotli from urllib3.exceptions import ( DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader, ) from urllib3.packages.six.moves ... | list(resp.stream()) | 706 | 8 |
urllib3/urllib3 | train | 306 | f6d5b4b8da14630acc86633bbfd0757603f07edd | train | test/test_response.py | train | urllib3/urllib3:test/test_response.py | 750 | 8 | assert | test_retries | import socket
import zlib
from io import BytesIO, BufferedReader
import pytest
import mock
from urllib3.response import HTTPResponse, brotli
from urllib3.exceptions import (
DecodeError,
ResponseNotChunked,
ProtocolError,
InvalidHeader,
)
from urllib3.packages.six.moves import http_client as httplib
... | retry | modified | f36b86fc33fec960fabf1a8840c15d13040f46f2e2c32000934a9d818389a1e0 | assert|test_retries|import socket import zlib from io import BytesIO, BufferedReader import pytest import mock from urllib3.response import HTTPResponse, brotli from urllib3.exceptions import ( DecodeError, ResponseNotChunked, ProtocolError, InvalidHeader, ) from urllib3.packages.six.moves import http_client as httplib... | retry | 750 | 8 |
urllib3/urllib3 | train | 307 | 728d9244665ef5b03103cb74d7b409ebe4f23b43 | train | test/test_retry.py | train | urllib3/urllib3:test/test_retry.py | 42 | 8 | assert | test_retry_both_specified | import datetime
import mock
import pytest
import time
from urllib3.response import HTTPResponse
from urllib3.packages import six
from urllib3.packages.six.moves import xrange
from urllib3.util.retry import Retry, RequestHistory
from urllib3.exceptions import (
ConnectTimeoutError,
InvalidHeader,
MaxRetryEr... | error | added | a803c3ca2a333bd3267c4499894df41a5c1bf3bbad9c39551186b06fdfe8ad66 | assert|test_retry_both_specified|import datetime import mock import pytest import time from urllib3.response import HTTPResponse from urllib3.packages import six from urllib3.packages.six.moves import xrange from urllib3.util.retry import Retry, RequestHistory from urllib3.exceptions import ( ConnectTimeoutError, Inval... | null | null | null |
urllib3/urllib3 | train | 307 | 728d9244665ef5b03103cb74d7b409ebe4f23b43 | train | test/test_retry.py | train | urllib3/urllib3:test/test_retry.py | 189 | 8 | assert | test_method_whitelist_with_status_forcelist | import datetime
import mock
import pytest
import time
from urllib3.response import HTTPResponse
from urllib3.packages import six
from urllib3.packages.six.moves import xrange
from urllib3.util.retry import Retry, RequestHistory
from urllib3.exceptions import (
ConnectTimeoutError,
InvalidHeader,
MaxRetryEr... | retry.is_retry("POST", status_code=500) | modified | 99fc5c7ed50c1df9d9c061408e8348b715aa78dc7db427e62ecd7dc2450e37d0 | assert|test_method_whitelist_with_status_forcelist|import datetime import mock import pytest import time from urllib3.response import HTTPResponse from urllib3.packages import six from urllib3.packages.six.moves import xrange from urllib3.util.retry import Retry, RequestHistory from urllib3.exceptions import ( ConnectT... | retry.is_retry("POST", status_code=500) | 189 | 8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.