repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
urllib3/urllib3 | from __future__ import annotations
import datetime
from test import DUMMY_POOL
from unittest import mock
import pytest
from urllib3.exceptions import (
ConnectTimeoutError,
InvalidHeader,
MaxRetryError,
ReadTimeoutError,
ResponseError,
SSLError,
)
from urllib3.response import HTTPResponse
fro... | 0.2 | assert | numeric_literal | test/test_retry.py | test_backoff | TestRetry | 145 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.fields import (
RequestField,
format_header_param,
format_header_param_html5,
format_header_param_rfc2231,
format_multipart_header_param,
guess_content_type,
)
class TestRequestField:
def test_render_parts(self) -> None:
... | parts | assert | variable | test/test_fields.py | test_render_parts | TestRequestField | 63 | null |
urllib3/urllib3 | from __future__ import annotations
import gzip
import typing
from test import LONG_TIMEOUT
from unittest import mock
import pytest
from dummyserver.socketserver import HAS_IPV6
from dummyserver.testcase import (
HypercornDummyServerTestCase,
IPv6HypercornDummyServerTestCase,
)
from urllib3 import HTTPHeaderD... | 1 | assert | numeric_literal | test/with_dummyserver/test_poolmanager.py | test_too_many_redirects | TestPoolManager | 228 | null |
urllib3/urllib3 | from __future__ import annotations
import binascii
import contextlib
import hashlib
import ipaddress
import os.path
import pathlib
import shutil
import socket
import ssl
import tempfile
from test import LONG_TIMEOUT, SHORT_TIMEOUT, resolvesLocalhostFQDN, withPyOpenSSL
from test.conftest import ServerConfig
import pyt... | 3 | assert | numeric_literal | test/with_dummyserver/test_proxy_poolmanager.py | test_proxy_pooling | TestHTTPProxyManager | 479 | null |
urllib3/urllib3 | from __future__ import annotations
import io
import logging
import socket
import ssl
import sys
import typing
import warnings
from itertools import chain
from test import ImportBlocker, ModuleStash, notBrotli, notZstd, onlyBrotli, onlyZstd
from unittest import mock
from unittest.mock import MagicMock, Mock, patch
from... | 2 | assert | numeric_literal | test/test_util.py | test_timeout | TestUtil | 683 | null |
urllib3/urllib3 | from __future__ import annotations
import concurrent.futures
import contextlib
import datetime
import os.path
import shutil
import ssl
import sys
import tempfile
import time
import typing
import warnings
from pathlib import Path
from test import (
LONG_TIMEOUT,
SHORT_TIMEOUT,
TARPIT_HOST,
requires_netw... | 443 | assert | numeric_literal | test/with_dummyserver/test_https.py | test_default_port | BaseTestHTTPS | 156 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.fields import (
RequestField,
format_header_param,
format_header_param_html5,
format_header_param_rfc2231,
format_multipart_header_param,
guess_content_type,
)
class TestRequestField:
@pytest.mark.parametrize(
("value"... | expect | assert | variable | test/test_fields.py | test_format_header_param_rfc2231_deprecated | TestRequestField | 78 | null |
urllib3/urllib3 | from __future__ import annotations
import ssl
import sys
import typing
from unittest import mock
import pytest
from urllib3.exceptions import ProxySchemeUnsupported, SSLError
from urllib3.util import ssl_
class TestSSL:
@pytest.mark.parametrize(
["pha", "expected_pha", "cert_reqs"],
[
... | expected_pha | assert | variable | test/test_ssl.py | test_create_urllib3_context_pha | TestSSL | 158 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.exceptions import MaxRetryError, NewConnectionError, ProxyError
from urllib3.poolmanager import ProxyManager
from urllib3.util.retry import Retry
from urllib3.util.url import parse_url
from .port_helpers import find_unused_port
class TestProxyManager:
... | provided_headers | assert | variable | test/test_proxymanager.py | test_proxy_headers | TestProxyManager | 33 | null |
urllib3/urllib3 | from __future__ import annotations
import contextlib
import gzip
import http.client as httplib
import socket
import ssl
import sys
import typing
import zlib
from base64 import b64decode
from http.client import IncompleteRead as httplib_IncompleteRead
from io import BufferedReader, BytesIO, TextIOWrapper
from test impo... | 6 | assert | numeric_literal | test/test_response.py | test_readinto_with_memoryview | TestResponse | 1,119 | null |
urllib3/urllib3 | from __future__ import annotations
import signal
import threading
import time
import typing
from socket import socket, socketpair
from types import FrameType
import pytest
from urllib3.util.wait import (
_have_working_poll,
poll_wait_for_socket,
select_wait_for_socket,
wait_for_read,
wait_for_soc... | 0 | assert | numeric_literal | test/test_wait.py | test_eintr | 133 | null | |
urllib3/urllib3 | from __future__ import annotations
import socket
from unittest import mock
import pytest
from urllib3.connection import _get_default_user_agent
from urllib3.exceptions import ConnectionError
from urllib3.http2.connection import (
HTTP2Connection,
_is_illegal_header_value,
_is_legal_header_name,
)
class ... | b"foo") | assert_* | string_literal | test/test_http2_connection.py | test_close | TestHTTP2Connection | 325 | null |
urllib3/urllib3 | from __future__ import annotations
import binascii
import contextlib
import hashlib
import ipaddress
import os.path
import pathlib
import shutil
import socket
import ssl
import tempfile
from test import LONG_TIMEOUT, SHORT_TIMEOUT, resolvesLocalhostFQDN, withPyOpenSSL
from test.conftest import ServerConfig
import pyt... | 200 | assert | numeric_literal | test/with_dummyserver/test_proxy_poolmanager.py | test_basic_proxy | TestHTTPProxyManager | 84 | null |
urllib3/urllib3 | from __future__ import annotations
import socket
from unittest import mock
import pytest
from urllib3.connection import _get_default_user_agent
from urllib3.exceptions import ConnectionError
from urllib3.http2.connection import (
HTTP2Connection,
_is_illegal_header_value,
_is_legal_header_name,
)
class ... | TypeError) | pytest.raises | variable | test/test_http2_connection.py | test_send_invalid_type | TestHTTP2Connection | 238 | null |
urllib3/urllib3 | from __future__ import annotations
import io
import logging
import platform
import socket
import time
import typing
import warnings
from test import LONG_TIMEOUT, SHORT_TIMEOUT
from threading import Event
from unittest import mock
from urllib.parse import urlencode
import pytest
from dummyserver.socketserver import ... | 1 | assert | numeric_literal | test/with_dummyserver/test_connectionpool.py | test_keepalive | TestConnectionPool | 553 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.exceptions import MaxRetryError, NewConnectionError, ProxyError
from urllib3.poolmanager import ProxyManager
from urllib3.util.retry import Retry
from urllib3.util.url import parse_url
from .port_helpers import find_unused_port
class TestProxyManager:
... | False | assert | bool_literal | test/test_proxymanager.py | test_proxy_tunnel | TestProxyManager | 63 | null |
urllib3/urllib3 | from __future__ import annotations
import concurrent.futures
import contextlib
import datetime
import os.path
import shutil
import ssl
import sys
import tempfile
import time
import typing
import warnings
from pathlib import Path
from test import (
LONG_TIMEOUT,
SHORT_TIMEOUT,
TARPIT_HOST,
requires_netw... | 1 | assert | numeric_literal | test/with_dummyserver/test_https.py | test_ssl_version_is_deprecated | BaseTestHTTPS | 834 | null |
urllib3/urllib3 | from __future__ import annotations
import gzip
import typing
from test import LONG_TIMEOUT
from unittest import mock
import pytest
from dummyserver.socketserver import HAS_IPV6
from dummyserver.testcase import (
HypercornDummyServerTestCase,
IPv6HypercornDummyServerTestCase,
)
from urllib3 import HTTPHeaderD... | 2 | assert | numeric_literal | test/with_dummyserver/test_poolmanager.py | test_redirect_without_preload_releases_connection | TestPoolManager | 376 | null |
urllib3/urllib3 | from __future__ import annotations
import concurrent.futures
import contextlib
import datetime
import os.path
import shutil
import ssl
import sys
import tempfile
import time
import typing
import warnings
from pathlib import Path
from test import (
LONG_TIMEOUT,
SHORT_TIMEOUT,
TARPIT_HOST,
requires_netw... | w | assert | variable | test/with_dummyserver/test_https.py | test_ssl_correct_system_time | BaseTestHTTPS | 710 | null |
urllib3/urllib3 | from __future__ import annotations
import datetime
from test import DUMMY_POOL
from unittest import mock
import pytest
from urllib3.exceptions import (
ConnectTimeoutError,
InvalidHeader,
MaxRetryError,
ReadTimeoutError,
ResponseError,
SSLError,
)
from urllib3.response import HTTPResponse
fro... | 0.4 | assert | numeric_literal | test/test_retry.py | test_backoff | TestRetry | 147 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
import urllib3
from dummyserver.testcase import (
HTTPSHypercornDummyServerTestCase,
HypercornDummyServerTestCase,
)
from urllib3.exceptions import InsecureRequestWarning
from ..test_no_ssl import TestWithoutSSL
class TestHTTPWithoutSSL(HypercornDummyServerTe... | 200 | assert | numeric_literal | test/with_dummyserver/test_no_ssl.py | test_simple | TestHTTPWithoutSSL | 25 | null |
urllib3/urllib3 | from __future__ import annotations
import pickle
import socket
from email.errors import MessageDefect
from test import DUMMY_POOL
import pytest
from urllib3.connection import HTTPConnection
from urllib3.connectionpool import HTTPConnectionPool
from urllib3.exceptions import (
ClosedPoolError,
ConnectTimeoutE... | result._message | assert | complex_expr | test/test_exceptions.py | test_exceptions | TestPickle | 57 | null |
urllib3/urllib3 | from __future__ import annotations
import socket
from unittest import mock
import pytest
from urllib3.connection import _get_default_user_agent
from urllib3.exceptions import ConnectionError
from urllib3.http2.connection import (
HTTP2Connection,
_is_illegal_header_value,
_is_legal_header_name,
)
class ... | [] | assert | collection | test/test_http2_connection.py | test_close | TestHTTP2Connection | 327 | null |
urllib3/urllib3 | from __future__ import annotations
import contextlib
import socket
import ssl
import threading
import typing
from test import LONG_TIMEOUT
import pytest
from dummyserver.app import hypercorn_app
from dummyserver.asgi_proxy import ProxyApp
from dummyserver.hypercornserver import run_hypercorn_in_thread
from dummyserv... | header_titles | assert | variable | dummyserver/testcase.py | assert_header_received | SocketDummyServerTestCase | 170 | null |
urllib3/urllib3 | from __future__ import annotations
import gc
import socket
from test import resolvesLocalhostFQDN
from unittest import mock
from unittest.mock import MagicMock, patch
import pytest
from urllib3 import connection_from_url
from urllib3.connectionpool import HTTPSConnectionPool
from urllib3.exceptions import LocationVa... | msg | assert | variable | test/test_poolmanager.py | test_deprecated_no_scheme | TestPoolManager | 281 | null |
urllib3/urllib3 | from __future__ import annotations
import gzip
import typing
from test import LONG_TIMEOUT
from unittest import mock
import pytest
from dummyserver.socketserver import HAS_IPV6
from dummyserver.testcase import (
HypercornDummyServerTestCase,
IPv6HypercornDummyServerTestCase,
)
from urllib3 import HTTPHeaderD... | {} | assert | collection | test/with_dummyserver/test_poolmanager.py | test_303_redirect_makes_request_lose_body | TestPoolManager | 391 | null |
urllib3/urllib3 | from __future__ import annotations
import concurrent.futures
import contextlib
import datetime
import os.path
import shutil
import ssl
import sys
import tempfile
import time
import typing
import warnings
from pathlib import Path
from test import (
LONG_TIMEOUT,
SHORT_TIMEOUT,
TARPIT_HOST,
requires_netw... | {} | assert | collection | test/with_dummyserver/test_https.py | test_http2_probe_result_is_cached | BaseTestHTTPS | 988 | null |
urllib3/urllib3 | from __future__ import annotations
import io
import logging
import socket
import ssl
import sys
import typing
import warnings
from itertools import chain
from test import ImportBlocker, ModuleStash, notBrotli, notZstd, onlyBrotli, onlyZstd
from unittest import mock
from unittest.mock import MagicMock, Mock, patch
from... | 1 | assert | numeric_literal | test/test_util.py | test_disable_warnings | TestUtil | 638 | null |
urllib3/urllib3 | from __future__ import annotations
import io
import logging
import socket
import ssl
import sys
import typing
import warnings
from itertools import chain
from test import ImportBlocker, ModuleStash, notBrotli, notZstd, onlyBrotli, onlyZstd
from unittest import mock
from unittest.mock import MagicMock, Mock, patch
from... | None) | assert_* | none_literal | test/test_util.py | test_ssl_wrap_socket_loads_the_cert_chain | TestUtilSSL | 1,001 | null |
urllib3/urllib3 | from __future__ import annotations
import platform
import select
import socket
import ssl
import threading
import typing
from unittest import mock
import pytest
from dummyserver.socketserver import DEFAULT_CA, DEFAULT_CERTS
from dummyserver.testcase import SocketDummyServerTestCase, consume_socket
from urllib3.util ... | ValueError) | pytest.raises | variable | test/test_ssltransport.py | test_various_flags_errors | TestSSLTransportWithMock | 541 | null |
urllib3/urllib3 | from __future__ import annotations
import os
from unittest import mock
import pytest
def setup_module() -> None:
try:
from urllib3.contrib.pyopenssl import inject_into_urllib3
inject_into_urllib3()
except ImportError as e:
pytest.skip(f"Could not import PyOpenSSL: {e!r}")
def teardo... | 1 | assert | numeric_literal | test/contrib/test_pyopenssl.py | test_get_subj_alt_name | TestPyOpenSSLHelpers | 103 | null |
urllib3/urllib3 | from __future__ import annotations
import io
import socket
import typing
import pytest
from dummyserver.testcase import (
ConnectionMarker,
SocketDummyServerTestCase,
consume_socket,
)
from urllib3 import HTTPConnectionPool
from urllib3.util import SKIP_HEADER
from urllib3.util.retry import Retry
class ... | body | assert | variable | test/with_dummyserver/test_chunked_transfer.py | _test_body | TestChunkedTransfer | 87 | null |
urllib3/urllib3 | from __future__ import annotations
import io
import socket
import typing
import pytest
from dummyserver.testcase import (
ConnectionMarker,
SocketDummyServerTestCase,
consume_socket,
)
from urllib3 import HTTPConnectionPool
from urllib3.util import SKIP_HEADER
from urllib3.util.retry import Retry
class ... | self.buffer | assert | complex_expr | test/with_dummyserver/test_chunked_transfer.py | test_chunks | TestChunkedTransfer | 51 | null |
urllib3/urllib3 | from __future__ import annotations
import io
import socket
import typing
import pytest
from dummyserver.testcase import (
ConnectionMarker,
SocketDummyServerTestCase,
consume_socket,
)
from urllib3 import HTTPConnectionPool
from urllib3.util import SKIP_HEADER
from urllib3.util.retry import Retry
class ... | b"transfer-encoding: test-transfer-encoding" | assert | string_literal | test/with_dummyserver/test_chunked_transfer.py | test_preserve_transfer_encoding_header | TestChunkedTransfer | 246 | null |
urllib3/urllib3 | from __future__ import annotations
import concurrent.futures
import contextlib
import datetime
import os.path
import shutil
import ssl
import sys
import tempfile
import time
import typing
import warnings
from pathlib import Path
from test import (
LONG_TIMEOUT,
SHORT_TIMEOUT,
TARPIT_HOST,
requires_netw... | 200 | assert | numeric_literal | test/with_dummyserver/test_https.py | test_http2_probe_result_is_cached | BaseTestHTTPS | 997 | null |
urllib3/urllib3 | from __future__ import annotations
import datetime
import socket
import typing
from http.client import ResponseNotReady
from unittest import mock
import pytest
from urllib3.connection import ( # type: ignore[attr-defined]
RECENT_DATE,
CertificateError,
HTTPConnection,
HTTPSConnection,
_match_hos... | cert | assert | variable | test/test_connection.py | test_match_hostname_mismatch | TestConnection | 70 | null |
urllib3/urllib3 | from __future__ import annotations
import signal
import threading
import time
import typing
from socket import socket, socketpair
from types import FrameType
import pytest
from urllib3.util.wait import (
_have_working_poll,
poll_wait_for_socket,
select_wait_for_socket,
wait_for_read,
wait_for_soc... | RuntimeError) | pytest.raises | variable | test/test_wait.py | test_wait_for_socket | 42 | null | |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.exceptions import MaxRetryError, NewConnectionError, ProxyError
from urllib3.poolmanager import ProxyManager
from urllib3.util.retry import Retry
from urllib3.util.url import parse_url
from .port_helpers import find_unused_port
class TestProxyManager:
... | ValueError) | pytest.raises | variable | test/test_proxymanager.py | test_invalid_scheme | TestProxyManager | 55 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.fields import (
RequestField,
format_header_param,
format_header_param_html5,
format_header_param_rfc2231,
format_multipart_header_param,
guess_content_type,
)
class TestRequestField:
def test_from_tuples(self) -> None:
... | 'form-data; name="file"; filename="スキー旅行.txt"' | assert | string_literal | test/test_fields.py | test_from_tuples | TestRequestField | 111 | null |
urllib3/urllib3 | from __future__ import annotations
import gzip
import typing
from test import LONG_TIMEOUT
from unittest import mock
import pytest
from dummyserver.socketserver import HAS_IPV6
from dummyserver.testcase import (
HypercornDummyServerTestCase,
IPv6HypercornDummyServerTestCase,
)
from urllib3 import HTTPHeaderD... | 200 | assert | numeric_literal | test/with_dummyserver/test_poolmanager.py | test_top_level_request | TestPoolManager | 653 | null |
urllib3/urllib3 | from __future__ import annotations
import socket
from unittest import mock
import pytest
from urllib3.connection import _get_default_user_agent
from urllib3.exceptions import ConnectionError
from urllib3.http2.connection import (
HTTP2Connection,
_is_illegal_header_value,
_is_legal_header_name,
)
class ... | 1) | assert_* | numeric_literal | test/test_http2_connection.py | test_send_iter | TestHTTP2Connection | 185 | null |
urllib3/urllib3 | from __future__ import annotations
import platform
import select
import socket
import ssl
import threading
import typing
from unittest import mock
import pytest
from dummyserver.socketserver import DEFAULT_CA, DEFAULT_CERTS
from dummyserver.testcase import SocketDummyServerTestCase, consume_socket
from urllib3.util ... | dict | assert | variable | test/test_ssltransport.py | validate_peercert | 91 | null | |
urllib3/urllib3 | from __future__ import annotations
import pickle
import socket
from email.errors import MessageDefect
from test import DUMMY_POOL
import pytest
from urllib3.connection import HTTPConnection
from urllib3.connectionpool import HTTPConnectionPool
from urllib3.exceptions import (
ClosedPoolError,
ConnectTimeoutE... | result._host | assert | complex_expr | test/test_exceptions.py | test_exceptions | TestPickle | 62 | null |
urllib3/urllib3 | from __future__ import annotations
import os
import re
import shutil
import sys
from pathlib import Path
import nox
nox.options.error_on_missing_interpreters = True
nox.options.default_venv_backend = "uv"
def tests_impl(
session: nox.Session,
extras: str | None = None,
extra_dependencies: list[str] | No... | None | assert | none_literal | noxfile.py | emscripten | 306 | null | |
urllib3/urllib3 | from __future__ import annotations
import gc
import socket
from test import resolvesLocalhostFQDN
from unittest import mock
from unittest.mock import MagicMock, patch
import pytest
from urllib3 import connection_from_url
from urllib3.connectionpool import HTTPSConnectionPool
from urllib3.exceptions import LocationVa... | pool3 | assert | variable | test/test_poolmanager.py | test_custom_pool_key | TestPoolManager | 328 | null |
urllib3/urllib3 | from __future__ import annotations
import datetime
import socket
import typing
from http.client import ResponseNotReady
from unittest import mock
import pytest
from urllib3.connection import ( # type: ignore[attr-defined]
RECENT_DATE,
CertificateError,
HTTPConnection,
HTTPSConnection,
_match_hos... | True | assert | bool_literal | test/test_connection.py | test_wrap_proxy_error | TestConnection | 228 | null |
urllib3/urllib3 | from __future__ import annotations
import socket
from unittest import mock
import pytest
from urllib3.connection import _get_default_user_agent
from urllib3.exceptions import ConnectionError
from urllib3.http2.connection import (
HTTP2Connection,
_is_illegal_header_value,
_is_legal_header_name,
)
class ... | 443 | assert | numeric_literal | test/test_http2_connection.py | test_default_socket_options | TestHTTP2Connection | 81 | null |
urllib3/urllib3 | from __future__ import annotations
import typing
import pytest
from urllib3._collections import HTTPHeaderDict
from urllib3._collections import RecentlyUsedContainer as Container
def d() -> HTTPHeaderDict:
header_dict = HTTPHeaderDict(Cookie="foo")
header_dict.add("cookie", "bar")
return header_dict
cl... | 4 | assert | numeric_literal | test/test_collections.py | test_create_from_kwargs | TestHTTPHeaderDict | 157 | null |
urllib3/urllib3 | from __future__ import annotations
import datetime
import socket
import typing
from http.client import ResponseNotReady
from unittest import mock
import pytest
from urllib3.connection import ( # type: ignore[attr-defined]
RECENT_DATE,
CertificateError,
HTTPConnection,
HTTPSConnection,
_match_hos... | new_err.args[0] | assert | complex_expr | test/test_connection.py | test_wrap_proxy_error | TestConnection | 229 | null |
urllib3/urllib3 | from __future__ import annotations
import ssl
import sys
import typing
from unittest import mock
import pytest
from urllib3.exceptions import ProxySchemeUnsupported, SSLError
from urllib3.util import ssl_
class TestSSL:
@pytest.mark.parametrize(
"kwargs",
[
{
"ssl_ve... | ValueError) | pytest.raises | variable | test/test_ssl.py | test_create_urllib3_context_ssl_version_and_ssl_min_max_version_errors | TestSSL | 193 | null |
urllib3/urllib3 | from __future__ import annotations
import datetime
import socket
import typing
from http.client import ResponseNotReady
from unittest import mock
import pytest
from urllib3.connection import ( # type: ignore[attr-defined]
RECENT_DATE,
CertificateError,
HTTPConnection,
HTTPSConnection,
_match_hos... | ValueError) | pytest.raises | variable | test/test_connection.py | test_match_hostname_no_cert | TestConnection | 43 | null |
urllib3/urllib3 | from __future__ import annotations
import gc
import socket
from test import resolvesLocalhostFQDN
from unittest import mock
from unittest.mock import MagicMock, patch
import pytest
from urllib3 import connection_from_url
from urllib3.connectionpool import HTTPSConnectionPool
from urllib3.exceptions import LocationVa... | 1 | assert | numeric_literal | test/test_poolmanager.py | test_manager_clear | TestPoolManager | 75 | null |
urllib3/urllib3 | from __future__ import annotations
import ssl
import sys
import typing
from unittest import mock
import pytest
from urllib3.exceptions import ProxySchemeUnsupported, SSLError
from urllib3.util import ssl_
class TestSSL:
def test_wrap_socket_given_ca_certs_no_load_default_certs(
self, monkeypatch: pytes... | None) | assert_* | none_literal | test/test_ssl.py | test_wrap_socket_given_ca_certs_no_load_default_certs | TestSSL | 104 | null |
urllib3/urllib3 | from __future__ import annotations
import io
import socket
import typing
import pytest
from dummyserver.testcase import (
ConnectionMarker,
SocketDummyServerTestCase,
consume_socket,
)
from urllib3 import HTTPConnectionPool
from urllib3.util import SKIP_HEADER
from urllib3.util.retry import Retry
class ... | chunk.encode("utf-8") | assert | func_call | test/with_dummyserver/test_chunked_transfer.py | test_chunks | TestChunkedTransfer | 60 | null |
urllib3/urllib3 | from __future__ import annotations
import http.client as httplib
import ssl
import typing
from http.client import HTTPException
from queue import Empty
from socket import error as SocketError
from ssl import SSLError as BaseSSLError
from test import SHORT_TIMEOUT
from unittest.mock import Mock, patch
import pytest
f... | None | assert | none_literal | test/test_connectionpool.py | test_pool_close | TestConnectionPool | 385 | null |
urllib3/urllib3 | from __future__ import annotations
import signal
import threading
import time
import typing
from socket import socket, socketpair
from types import FrameType
import pytest
from urllib3.util.wait import (
_have_working_poll,
poll_wait_for_socket,
select_wait_for_socket,
wait_for_read,
wait_for_soc... | b"x" | assert | string_literal | test/test_wait.py | test_wait_for_socket | 68 | null | |
urllib3/urllib3 | from __future__ import annotations
import io
import logging
import platform
import socket
import time
import typing
import warnings
from test import LONG_TIMEOUT, SHORT_TIMEOUT
from threading import Event
from unittest import mock
from urllib.parse import urlencode
import pytest
from dummyserver.socketserver import ... | 3 | assert | numeric_literal | test/with_dummyserver/test_connectionpool.py | test_connection_count | TestConnectionPool | 695 | null |
urllib3/urllib3 | from __future__ import annotations
import contextlib
import typing
from http.client import ResponseNotReady
from unittest import mock
import pytest
from dummyserver.testcase import HypercornDummyServerTestCase as server
from urllib3 import HTTPConnectionPool
from urllib3.response import HTTPResponse
def pool() -> t... | "Invalid proxy scheme for tunneling: 'socks', must be either 'http' or 'https'" | assert | string_literal | test/with_dummyserver/test_connection.py | test_invalid_tunnel_scheme | 137 | null | |
urllib3/urllib3 | from __future__ import annotations
import io
import logging
import socket
import ssl
import sys
import typing
import warnings
from itertools import chain
from test import ImportBlocker, ModuleStash, notBrotli, notZstd, onlyBrotli, onlyZstd
from unittest import mock
from unittest.mock import MagicMock, Mock, patch
from... | port | assert | variable | test/test_util.py | test_scheme_host_port | TestUtil | 149 | null |
urllib3/urllib3 | from __future__ import annotations
import ssl
import sys
import typing
from unittest import mock
import pytest
from urllib3.exceptions import ProxySchemeUnsupported, SSLError
from urllib3.util import ssl_
class TestSSL:
def test_create_urllib3_context_set_ciphers(
self, monkeypatch: pytest.MonkeyPatch
... | 1 | assert | numeric_literal | test/test_ssl.py | test_create_urllib3_context_set_ciphers | TestSSL | 59 | null |
urllib3/urllib3 | from __future__ import annotations
import ssl
import sys
import typing
from unittest import mock
import pytest
from urllib3.exceptions import ProxySchemeUnsupported, SSLError
from urllib3.util import ssl_
class TestSSL:
def test_wrap_socket_no_ssltransport(self) -> None:
with mock.patch("urllib3.util.s... | ProxySchemeUnsupported) | pytest.raises | variable | test/test_ssl.py | test_wrap_socket_no_ssltransport | TestSSL | 122 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.fields import (
RequestField,
format_header_param,
format_header_param_html5,
format_header_param_rfc2231,
format_multipart_header_param,
guess_content_type,
)
class TestRequestField:
def test_from_tuples_rfc2231(self) -> None... | "form-data; name=\"file\"; filename*=utf-8''n%C3%A4me" | assert | string_literal | test/test_fields.py | test_from_tuples_rfc2231 | TestRequestField | 120 | null |
urllib3/urllib3 | from __future__ import annotations
import sys
import typing
import pytest
from urllib3.fields import _TYPE_FIELD_VALUE_TUPLE
from ...port_helpers import find_unused_port
pytest_pyodide = pytest.importorskip("pytest_pyodide")
from pytest_pyodide import run_in_pyodide # type: ignore[import-not-found] # noqa: E402
... | 0 | assert | numeric_literal | test/contrib/emscripten/test_emscripten.py | pyodide_test | 111 | null | |
urllib3/urllib3 | from __future__ import annotations
import gc
import socket
from test import resolvesLocalhostFQDN
from unittest import mock
from unittest.mock import MagicMock, patch
import pytest
from urllib3 import connection_from_url
from urllib3.connectionpool import HTTPSConnectionPool
from urllib3.exceptions import LocationVa... | None | assert | none_literal | test/test_poolmanager.py | test_thread_safty | TestPoolManager | 486 | null |
urllib3/urllib3 | from __future__ import annotations
import contextlib
import errno
import http.client
import io
import os
import os.path
import select
import shutil
import socket
import ssl
import tempfile
import threading
import time
import typing
import zlib
from collections import OrderedDict
from pathlib import Path
from test impo... | 2 | assert | numeric_literal | test/with_dummyserver/test_socketlevel.py | test_release_conn_param_is_respected_after_timeout_retry | TestSocketClosing | 954 | null |
urllib3/urllib3 | from __future__ import annotations
import pickle
import socket
from email.errors import MessageDefect
from test import DUMMY_POOL
import pytest
from urllib3.connection import HTTPConnection
from urllib3.connectionpool import HTTPConnectionPool
from urllib3.exceptions import (
ClosedPoolError,
ConnectTimeoutE... | str(hpe) | assert | func_call | test/test_exceptions.py | test_header_parsing_errors | TestFormat | 73 | null |
urllib3/urllib3 | from __future__ import annotations
import http.cookiejar
import urllib
from unittest import mock
import pytest
import urllib3.http2
from urllib3.response import HTTPResponse
class TestCookiejar:
def test_extract(self) -> None:
request = urllib.request.Request("http://google.com")
cookiejar = htt... | len(cookies) | assert | func_call | test/test_compatibility.py | test_extract | TestCookiejar | 26 | null |
urllib3/urllib3 | from __future__ import annotations
import contextlib
import errno
import http.client
import io
import os
import os.path
import select
import shutil
import socket
import ssl
import tempfile
import threading
import time
import typing
import zlib
from collections import OrderedDict
from pathlib import Path
from test impo... | b"" | assert | string_literal | test/with_dummyserver/test_socketlevel.py | _run_read_None | TestSSL | 1,870 | null |
urllib3/urllib3 | from __future__ import annotations
import socket
import threading
import typing
from socket import getaddrinfo as real_getaddrinfo
from socket import timeout as SocketTimeout
from test import SHORT_TIMEOUT
from unittest.mock import Mock, patch
import pytest
import socks as py_socks # type: ignore[import-untyped]
fr... | 80 | assert | numeric_literal | test/contrib/test_socks.py | request_handler | TestSocks5Proxy | 254 | null |
urllib3/urllib3 | from __future__ import annotations
import datetime
import socket
import typing
from http.client import ResponseNotReady
from unittest import mock
import pytest
from urllib3.connection import ( # type: ignore[attr-defined]
RECENT_DATE,
CertificateError,
HTTPConnection,
HTTPSConnection,
_match_hos... | request_headers | assert | variable | test/test_connection.py | test_skip_header | TestConnection | 318 | null |
urllib3/urllib3 | from __future__ import annotations
import datetime
import socket
import typing
from http.client import ResponseNotReady
from unittest import mock
import pytest
from urllib3.connection import ( # type: ignore[attr-defined]
RECENT_DATE,
CertificateError,
HTTPConnection,
HTTPSConnection,
_match_hos... | SSLError) | pytest.raises | variable | test/test_connection.py | test_assert_fingerprint_closes_socket | TestConnection | 254 | null |
urllib3/urllib3 | from __future__ import annotations
import contextlib
import typing
from http.client import ResponseNotReady
from unittest import mock
import pytest
from dummyserver.testcase import HypercornDummyServerTestCase as server
from urllib3 import HTTPConnectionPool
from urllib3.response import HTTPResponse
def pool() -> t... | 200 | assert | numeric_literal | test/with_dummyserver/test_connection.py | test_connection_state_properties | 99 | null | |
urllib3/urllib3 | from __future__ import annotations
import gc
import socket
from test import resolvesLocalhostFQDN
from unittest import mock
from unittest.mock import MagicMock, patch
import pytest
from urllib3 import connection_from_url
from urllib3.connectionpool import HTTPSConnectionPool
from urllib3.exceptions import LocationVa... | 5 | assert | numeric_literal | test/test_poolmanager.py | test_many_urls | TestPoolManager | 69 | null |
commaai/opendbc | import pytest
import random
import time
from collections import defaultdict
from opendbc.car.can_definitions import CanData
from opendbc.car.car_helpers import interfaces
from opendbc.car.structs import CarParams
from opendbc.car.fingerprints import FW_VERSIONS
from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ... | {e for e, _, _ in version_ecus} | assert | collection | opendbc/car/tests/test_fw_fingerprint.py | test_request_ecus_in_versions | TestFwFingerprint | 179 | null |
commaai/opendbc | from hypothesis import settings, given, strategies as st
import pytest
from opendbc.car import gen_empty_fingerprint
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.hyundai.interface import CarInterface
from opendbc.car.hyundai.hyundaicanfd import CanBus
fr... | {(b"AEhe-G2000", None)} | assert | collection | opendbc/car/hyundai/tests/test_hyundai.py | test_platform_codes_spot_check | TestHyundaiFingerprint | 200 | null |
commaai/opendbc | from hypothesis import given, settings, strategies as st
from opendbc.car import Bus
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.toyota.fingerprints import FW_VERSIONS
from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC... | [e[0] for e in ecus] | assert | collection | opendbc/car/toyota/tests/test_toyota.py | test_platform_code_ecus_available | TestToyotaFingerprint | 91 | null |
commaai/opendbc | import random
import unittest
import numpy as np
from opendbc.car.lateral import get_max_angle_delta_vm, get_max_angle_vm
from opendbc.car.tesla.teslacan import get_steer_ctrl_type
from opendbc.car.tesla.values import CarControllerParams, TeslaSafetyFlags, TeslaFlags
from opendbc.car.tesla.carcontroller import get_saf... | self._rx(no_aeb_msg_cam)) | self.assertEqual | func_call | opendbc/safety/tests/test_tesla.py | test_stock_aeb_no_cancel | TestTeslaStockSafety | 393 | null |
commaai/opendbc | import random
import unittest
import numpy as np
from opendbc.car.lateral import get_max_angle_delta_vm, get_max_angle_vm
from opendbc.car.tesla.teslacan import get_steer_ctrl_type
from opendbc.car.tesla.values import CarControllerParams, TeslaSafetyFlags, TeslaFlags
from opendbc.car.tesla.carcontroller import get_saf... | self._tx(no_lkas_msg)) | self.assertTrue | func_call | opendbc/safety/tests/test_tesla.py | test_stock_lkas_passthrough | TestTeslaSafetyBase | 289 | null |
commaai/opendbc | import argparse
from collections import Counter
from tqdm import tqdm
from opendbc.car.carlog import carlog
from opendbc.safety.tests.libsafety import libsafety_py
from opendbc.safety.tests.safety_replay.helpers import package_can_msg, init_segment
def replay_drive(msgs, safety_mode, param, alternative_experience):
... | 0 | assert | numeric_literal | opendbc/safety/tests/safety_replay/replay_drive.py | replay_drive | 17 | null | |
commaai/opendbc | import pytest
from opendbc.car.can_definitions import CanData
from opendbc.car.car_helpers import FRAME_FINGERPRINT, can_fingerprint
from opendbc.car.fingerprints import _FINGERPRINTS as FINGERPRINTS
class TestCanFingerprint:
def test_timing(self, subtests):
# just pick any CAN fingerprinting car
car_model ... | expected_frames + 2 | assert | complex_expr | opendbc/car/tests/test_can_fingerprint.py | test_timing | TestCanFingerprint | 55 | null |
commaai/opendbc | from hypothesis import settings, given, strategies as st
import pytest
from opendbc.car import gen_empty_fingerprint
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.hyundai.interface import CarInterface
from opendbc.car.hyundai.hyundaicanfd import CanBus
fr... | {(b"DH", b"150210")} | assert | collection | opendbc/car/hyundai/tests/test_hyundai.py | test_platform_codes_spot_check | TestHyundaiFingerprint | 196 | null |
commaai/opendbc | from hypothesis import settings, given, strategies as st
import pytest
from opendbc.car import gen_empty_fingerprint
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.hyundai.interface import CarInterface
from opendbc.car.hyundai.hyundaicanfd import CanBus
fr... | set() | assert | func_call | opendbc/car/hyundai/tests/test_hyundai.py | test_can_features | TestHyundaiFingerprint | 74 | null |
commaai/opendbc | import unittest
import opendbc.safety.tests.common as common
from opendbc.car.structs import CarParams
from opendbc.safety.tests.libsafety import libsafety_py
class TestDefaultRxHookBase(common.SafetyTest):
FWD_BUS_LOOKUP = {}
def test_rx_hook(self):
# default rx hook allows all msgs
for bus in range(4):... | self._rx(common.make_msg(bus, addr, 8))) | self.assertTrue | func_call | opendbc/safety/tests/test_defaults.py | test_rx_hook | TestDefaultRxHookBase | 16 | null |
commaai/opendbc | from opendbc.car.values import PLATFORMS
class TestPlatformConfigs:
def test_configs(self, subtests):
for name, platform in PLATFORMS.items():
with subtests.test(platform=str(platform)):
assert platform.config._frozen
if platform != "MOCK":
assert len(platform.config.dbc_dict) >... | None | assert | none_literal | opendbc/car/tests/test_platform_configs.py | test_configs | TestPlatformConfigs | 17 | null |
commaai/opendbc | import unittest
import opendbc.safety.tests.common as common
from opendbc.safety.tests.libsafety import libsafety_py
from opendbc.safety.tests.common import make_msg
class HyundaiLongitudinalBase(common.LongitudinalAccelSafetyTest):
DISABLED_ECU_UDS_MSG: tuple[int, int]
DISABLED_ECU_ACTUATION_MSG: tuple[int, int... | self.safety.get_relay_malfunction()) | self.assertFalse | func_call | opendbc/safety/tests/hyundai_common.py | test_disabled_ecu_alive | HyundaiLongitudinalBase | 151 | null |
commaai/opendbc | import unittest
from opendbc.car.structs import CarParams
import opendbc.safety.tests.common as common
from opendbc.safety.tests.libsafety import libsafety_py
from opendbc.safety.tests.common import CANPackerSafety
class TestBody(common.SafetyTest):
TX_MSGS = [[0x250, 0], [0x251, 0],
[0x1, 0], [0x1, 1]... | self._tx(common.make_msg(0, 0x1, 8))) | self.assertTrue | func_call | opendbc/safety/tests/test_body.py | test_can_flasher | TestBody | 51 | null |
commaai/opendbc | import pytest
from opendbc.can import CANDefine, CANPacker, CANParser
from opendbc.can.tests import TEST_DBC
class TestCanParserPackerExceptions:
def test_civic_exceptions(self):
dbc_file = "honda_civic_touring_2016_can_generated"
dbc_invalid = dbc_file + "abcdef"
msgs = [("STEERING_CONTROL", 50)]
w... | IndexError) | pytest.raises | variable | opendbc/can/tests/test_dbc_exceptions.py | test_civic_exceptions | TestCanParserPackerExceptions | 22 | null |
commaai/opendbc | from hypothesis import given, settings, strategies as st
from opendbc.car import Bus
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.toyota.fingerprints import FW_VERSIONS
from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC... | {CAR.TOYOTA_RAV4_TSS2_2023} | assert | collection | opendbc/car/toyota/tests/test_toyota.py | test_lta_platforms | TestToyotaInterfaces | 27 | null |
commaai/opendbc | import pytest
import math
import numpy as np
from opendbc.car.honda.interface import CarInterface
from opendbc.car.honda.values import CAR
from opendbc.car.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices
class TestVehicleModel:
def setup_method(self):
CP = CarInterface.get_non_essentia... | pytest.approx(new_sa) | assert | func_call | opendbc/car/tests/test_vehicle_model.py | test_round_trip_yaw_rate | TestVehicleModel | 24 | null |
commaai/opendbc | from hypothesis import settings, given, strategies as st
import pytest
from opendbc.car import gen_empty_fingerprint
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.hyundai.interface import CarInterface
from opendbc.car.hyundai.hyundaicanfd import CanBus
fr... | radar | assert | variable | opendbc/car/hyundai/tests/test_hyundai.py | test_feature_detection | TestHyundaiFingerprint | 63 | null |
commaai/opendbc | from hypothesis import given, settings, strategies as st
from opendbc.car import Bus
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.toyota.fingerprints import FW_VERSIONS
from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC... | "toyota_nodsu_pt_generated" | assert | string_literal | opendbc/car/toyota/tests/test_toyota.py | test_tss2_dbc | TestToyotaInterfaces | 34 | null |
commaai/opendbc | import os
import math
import hypothesis.strategies as st
import pytest
from functools import cache
from hypothesis import Phase, given, settings
from collections.abc import Callable
from typing import Any
from opendbc.car import DT_CTRL, CanData, structs
from opendbc.car.car_helpers import interfaces
from opendbc.car.... | 0 | assert | numeric_literal | opendbc/car/tests/test_car_interfaces.py | test_car_interfaces | TestCarInterfaces | 76 | null |
commaai/opendbc | import pytest
import random
import time
from collections import defaultdict
from opendbc.car.can_definitions import CanData
from opendbc.car.car_helpers import interfaces
from opendbc.car.structs import CarParams
from opendbc.car.fingerprints import FW_VERSIONS
from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ... | set(config.extra_ecus) | assert | func_call | opendbc/car/tests/test_fw_fingerprint.py | test_missing_versions_and_configs | TestFwFingerprint | 154 | null |
commaai/opendbc | import enum
import unittest
from opendbc.car.subaru.values import SubaruSafetyFlags
from opendbc.car.structs import CarParams
from opendbc.safety.tests.libsafety import libsafety_py
import opendbc.safety.tests.common as common
from opendbc.safety.tests.common import CANPackerSafety
from functools import partial
def l... | self._tx(self._es_uds_msg(tester_present))) | self.assertTrue | func_call | opendbc/safety/tests/test_subaru.py | test_es_uds_message | TestSubaruGen2LongitudinalSafety | 220 | null |
commaai/opendbc | import sys
import time
import struct
from enum import IntEnum, Enum
from dataclasses import dataclass
class CcpClient:
def __init__(self, panda, tx_addr: int, rx_addr: int, bus: int=0, byte_order: BYTE_ORDER=BYTE_ORDER.BIG_ENDIAN, debug=False):
self.tx_addr = tx_addr
self.rx_addr = rx_addr
self.can_bus =... | 8 | assert | numeric_literal | opendbc/car/ccp.py | _send_cro | CcpClient | 131 | null |
commaai/opendbc | import pytest
import random
from opendbc.can import CANPacker, CANParser
from opendbc.can.tests import TEST_DBC
MAX_BAD_COUNTER = 5
class TestCanParserPacker:
def test_packer(self):
packer = CANPacker(TEST_DBC)
for b in range(6):
for i in range(256):
values = {"COUNTER": i}
addr, dat... | i | assert | variable | opendbc/can/tests/test_packer_parser.py | test_packer | TestCanParserPacker | 20 | null |
commaai/opendbc | from hypothesis import given, settings, strategies as st
from opendbc.car import Bus
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.toyota.fingerprints import FW_VERSIONS
from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC... | 0 | assert | numeric_literal | opendbc/car/toyota/tests/test_toyota.py | test_car_sets | TestToyotaInterfaces | 22 | null |
commaai/opendbc | import random
import unittest
import numpy as np
from opendbc.car.lateral import get_max_angle_delta_vm, get_max_angle_vm
from opendbc.car.tesla.teslacan import get_steer_ctrl_type
from opendbc.car.tesla.values import CarControllerParams, TeslaSafetyFlags, TeslaFlags
from opendbc.car.tesla.carcontroller import get_saf... | self._tx(no_aeb_msg)) | self.assertTrue | func_call | opendbc/safety/tests/test_tesla.py | test_stock_aeb_no_cancel | TestTeslaStockSafety | 395 | null |
commaai/opendbc | from collections import defaultdict
import pytest
from opendbc.car.car_helpers import interfaces
from opendbc.car.docs import get_all_car_docs
from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType
from opendbc.car.honda.values import CAR as HONDA
from opendbc.car.values import PLATFORMS
... | 0 | assert | numeric_literal | opendbc/car/tests/test_docs.py | test_harnesses | TestCarDocs | 76 | null |
commaai/opendbc | import numpy as np
import random
import unittest
import itertools
from opendbc.car.toyota.values import ToyotaSafetyFlags
from opendbc.car.structs import CarParams
from opendbc.safety.tests.libsafety import libsafety_py
import opendbc.safety.tests.common as common
from opendbc.safety.tests.common import CANPackerSafet... | self._tx(self._accel_msg_343(accel))) | self.assertFalse | func_call | opendbc/safety/tests/test_toyota.py | test_acc_cancel | TestToyotaStockLongitudinalBase | 291 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.