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 |
|---|---|---|---|---|---|---|---|---|---|
steamship-core/python-client | from __future__ import annotations
import pytest
from steamship_tests.utils.fixtures import get_steamship_client
from steamship import SteamshipError
from steamship.base.model import CamelModel
from steamship.base.tasks import TaskState
def test_task_update():
client = get_steamship_client()
# We'll backgro... | orig_input | assert | variable | tests/steamship_tests/base/test_task.py | test_task_update | 105 | null | |
steamship-core/python-client | import uuid
from typing import List
import pytest
from steamship import Block, DocTag
from steamship.agents.schema import ChatHistory
from steamship.agents.schema.message_selectors import MessageSelector
from steamship.client import Steamship
from steamship.data import TagKind
from steamship.data.tags.tag_constants i... | RoleTag.SYSTEM | assert | complex_expr | tests/steamship_tests/data/test_chat.py | test_chat_append_system | 37 | null | |
steamship-core/python-client | import pytest
from assets.packages.package_verifying_instance_init import PackageWithInstanceInit
from assets.plugins.generators.plugin_with_instance_init import TestGeneratorWithInit
from assets.plugins.taggers.plugin_trainable_tagger import TestTrainableTaggerPlugin
from steamship_tests import PACKAGES_PATH, PLUGINS_... | 4 | assert | numeric_literal | tests/steamship_tests/app/integration/test_instance_init.py | test_plugin_init_dir | 27 | null | |
steamship-core/python-client | import pytest
from steamship import Steamship
from steamship.agents.examples.document_qa_agent import ExampleDocumentQAService
@pytest.mark.usefixtures("client")
def test_qa_agent_inits(client: Steamship):
agent = ExampleDocumentQAService(client=client)
assert agent is not | None | assert | none_literal | tests/steamship_tests/agents/test_qa_agent.py | test_qa_agent_inits | 10 | null | |
steamship-core/python-client | from typing import Any, Dict, Type
import pytest
from steamship import Steamship, SteamshipError
from steamship.agents.llms import OpenAI
from steamship.agents.mixins.transports.telegram import TelegramTransport, TelegramTransportConfig
from steamship.agents.react import ReACTAgent
from steamship.agents.schema import... | 6 | assert | numeric_literal | tests/steamship_tests/app/unit/test_routes_on_superclasses.py | test_l1_routes | 114 | null | |
steamship-core/python-client | import base64
import json
from steamship.base.model import CamelModel
from steamship.plugin.outputs.raw_data_plugin_output import RawDataPluginOutput
from steamship.utils.binary_utils import flexi_create
def test_dump_json():
assert json.dumps(flexi_create(json="Hi")[0]) == | '"Hi"' | assert | string_literal | tests/steamship_tests/base/test_binary_utils.py | test_dump_json | 15 | null | |
steamship-core/python-client | import pytest
from steamship import Block, File, MimeTypes, Steamship
from steamship.agents.schema import Action
from steamship.agents.schema.cache import ActionCache, LLMCache
@pytest.mark.usefixtures("client")
def test_llm_cache(client: Steamship):
context_keys = {"id": "test"}
cache = LLMCache.get_or_creat... | "other" | assert | string_literal | tests/steamship_tests/agents/test_cache.py | test_llm_cache | 26 | null | |
steamship-core/python-client | import contextlib
import io
import os
import zipfile
from pathlib import Path
from typing import Any, Dict, List, Optional
from steamship_tests import ROOT_PATH, SRC_PATH, TEST_ASSETS_PATH
from steamship import Package, PackageInstance, PackageVersion, Steamship
from steamship.data.invocable_init_status import Invoca... | package.id | assert | complex_expr | tests/steamship_tests/utils/deployables.py | deploy_package | 146 | null | |
steamship-core/python-client | from steamship_tests.utils.fixtures import get_steamship_client
from steamship_tests.utils.random import random_index
from steamship import DocTag, File, MimeTypes, PluginInstance, Tag
_TEST_EMBEDDER = "test-embedder"
T = "A nice poem"
P1_1 = "Roses are red."
P1_2 = "Violets are blue."
P2_1 = "Sugar is sweet."
P2_2 ... | 1 | assert | numeric_literal | tests/steamship_tests/client/operations/test_embed_file.py | test_file_parse | 54 | null | |
steamship-core/python-client | import uuid
import pytest
from steamship_tests.utils.fixtures import get_steamship_client
from steamship import SteamshipError, Workspace
from steamship.base.request import SortOrder
def test_create_use_delete_workspace():
client = get_steamship_client()
default = Workspace.get(client=client)
test_one = ... | test_two | assert | variable | tests/steamship_tests/data/test_workspace.py | test_create_use_delete_workspace | 74 | null | |
steamship-core/python-client | import io
import json
from datetime import datetime
import pytest
import requests
from steamship_tests import PLUGINS_PATH
from steamship_tests.utils.deployables import deploy_plugin
from steamship import MimeTypes, SteamshipError
from steamship.base.request import SortOrder
from steamship.client import Steamship
fro... | a | assert | variable | tests/steamship_tests/data/test_file.py | test_file_list_paging | 249 | null | |
steamship-core/python-client | from typing import Any, Dict, Type
import pytest
from steamship import Steamship, SteamshipError
from steamship.agents.llms import OpenAI
from steamship.agents.mixins.transports.telegram import TelegramTransport, TelegramTransportConfig
from steamship.agents.react import ReACTAgent
from steamship.agents.schema import... | "foo" | assert | string_literal | tests/steamship_tests/app/unit/test_routes_on_superclasses.py | test_l1_routes | 103 | null | |
steamship-core/python-client | import json
import logging
import time
from typing import Any, List, Optional, Union
import pytest
import requests
import sseclient
from pydantic.fields import PrivateAttr
from steamship_tests import SRC_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship import Block, File, Steamship, St... | 0 | assert | numeric_literal | tests/steamship_tests/agents/test_agent_service.py | test_example_with_caching_service | 48 | 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
... | 2 | assert | numeric_literal | test/contrib/emscripten/test_emscripten.py | pyodide_test | 91 | 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... | 7 | assert | numeric_literal | test/test_util.py | test_timeout | TestUtil | 700 | 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... | 3 | assert | numeric_literal | test/test_util.py | test_timeout | TestUtil | 679 | 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... | 98 | assert | numeric_literal | test/test_retry.py | test_backoff | TestRetry | 146 | 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... | 8 | assert | numeric_literal | test/with_dummyserver/test_socketlevel.py | test_connection_closed_on_read_timeout_preload_false | TestSocketClosing | 855 | 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 ... | cert | assert | variable | test/test_ssltransport.py | validate_peercert | 92 | 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... | 0 | assert | numeric_literal | test/test_connectionpool.py | _test | TestConnectionPool | 572 | 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 ... | 0 | assert | numeric_literal | test/test_ssltransport.py | validate_peercert | 88 | 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... | 1 | assert | numeric_literal | test/with_dummyserver/test_connection.py | test_audit_event | 43 | 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"bar") | assert_* | string_literal | test/test_http2_connection.py | test_send_bytes | TestHTTP2Connection | 133 | 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 ... | 0 | assert | numeric_literal | test/with_dummyserver/test_chunked_transfer.py | test_remove_user_agent_header | TestChunkedTransfer | 218 | 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 ... | header.split(b"\r\n") | assert | func_call | test/with_dummyserver/test_chunked_transfer.py | _test_body | TestChunkedTransfer | 80 | 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... | True | assert | bool_literal | test/test_connectionpool.py | test_put_conn_when_pool_is_full_nonblocking | TestConnectionPool | 251 | 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:
... | MaxRetryError) | pytest.raises | variable | test/test_proxymanager.py | test_proxy_connect_retry | TestProxyManager | 83 | 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
... | 1 | assert | numeric_literal | test/contrib/emscripten/test_emscripten.py | pyodide_test | 85 | 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... | 1 | assert | numeric_literal | test/with_dummyserver/test_socketlevel.py | run_client_cert_with_password_test | TestClientCerts | 382 | 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_assert_fingerprint_raises_exception_on_none_cert(self) -> None:
with pyte... | SSLError) | pytest.raises | variable | test/test_ssl.py | test_assert_fingerprint_raises_exception_on_none_cert | TestSSL | 245 | 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... | [] | assert | collection | test/test_poolmanager.py | test_pool_kwargs_socket_options | TestPoolManager | 377 | 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... | h | assert | variable | test/test_collections.py | test_create_from_kwargs | TestHTTPHeaderDict | 158 | 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... | 5 | assert | numeric_literal | test/with_dummyserver/test_socketlevel.py | test_chunked_specified | TestContentFraming | 2,623 | 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_make_multipart_empty_filename(sel... | 'Content-Disposition: form-data; name="somename"; filename=""\r\n' "Content-Type: application/octet-stream\r\n" "\r\n" | assert | string_literal | test/test_fields.py | test_make_multipart_empty_filename | TestRequestField | 53 | 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 ... | None | assert | none_literal | test/test_http2_connection.py | test_close | TestHTTP2Connection | 326 | 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... | pool2 | assert | variable | test/test_poolmanager.py | test_custom_pool_key | TestPoolManager | 329 | 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... | dur | assert | variable | test/test_wait.py | test_eintr | 129 | 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... | 0 | assert | numeric_literal | test/with_dummyserver/test_socketlevel.py | _run_read1_None | TestSSL | 1,885 | 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 ... | x | assert | variable | test/with_dummyserver/test_connectionpool.py | test_stream_keepalive | TestConnectionPool | 874 | 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... | False | assert | bool_literal | test/test_poolmanager.py | test_pool_manager_no_url_absolute_form | TestPoolManager | 410 | 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... | b"" | assert | string_literal | test/contrib/test_socks.py | test_basic_request | TestSocks5Proxy | 277 | 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:
... | 'name="value"; filename="value"' | assert | string_literal | test/test_fields.py | test_render_parts | TestRequestField | 66 | 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... | "Can't specify both 'ssl_version' and either 'ssl_minimum_version' or 'ssl_maximum_version'" | assert | string_literal | test/test_ssl.py | test_create_urllib3_context_ssl_version_and_ssl_min_max_version_errors | TestSSL | 196 | 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 ... | str | assert | variable | test/test_ssltransport.py | test_tls_in_tls_makefile_rw_text | TlsInTlsTestCase | 488 | 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... | 2 | assert | numeric_literal | test/with_dummyserver/test_proxy_poolmanager.py | test_proxy_pooling | TestHTTPProxyManager | 474 | 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... | 0 | assert | numeric_literal | test/test_util.py | test_parse_url_only_zeros | TestUtil | 352 | 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... | conn.port) | assert_* | complex_expr | test/with_dummyserver/test_connection.py | test_audit_event | 36 | 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_no_context(self) -> None:
with mock.patch("urllib3.util.ssl... | TypeError) | pytest.raises | variable | test/test_ssl.py | test_create_urllib3_no_context | TestSSL | 64 | 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_ssl_wrap_socket_creates_new_context | TestUtilSSL | 1,010 | 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... | 9 | assert | numeric_literal | test/test_response.py | test_multiple_chunks | TestBytesQueueBuffer | 95 | 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 ... | 1 | assert | numeric_literal | test/with_dummyserver/test_chunked_transfer.py | test_removes_duplicate_host_header | TestChunkedTransfer | 166 | 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... | ValueError) | pytest.raises | variable | test/with_dummyserver/test_connection.py | test_invalid_tunnel_scheme | 135 | 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... | CertificateError) | pytest.raises | variable | test/test_connection.py | test_match_hostname_dns_with_brackets_doesnt_match | TestConnection | 189 | 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... | 80 | assert | numeric_literal | test/test_util.py | test_parse_url_remove_leading_zeros | TestUtil | 348 | 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... | 2 | assert | numeric_literal | test/test_connectionpool.py | _test | TestConnectionPool | 573 | 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 ... | None | assert | none_literal | test/test_ssltransport.py | validate_request | 55 | 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
... | "Dummy server!" | assert | string_literal | test/contrib/emscripten/test_emscripten.py | test_fn | 688 | 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(result) | assert | func_call | test/test_exceptions.py | test_exceptions | TestPickle | 58 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.fields import RequestField
from urllib3.filepost import _TYPE_FIELDS, encode_multipart_formdata
BOUNDARY = "!! test boundary !!"
BOUNDARY_BYTES = BOUNDARY.encode()
class TestMultipartEncoding:
@pytest.mark.parametrize(
"fields",
[
... | expected | assert | variable | test/test_filepost.py | test_field_encoding | TestMultipartEncoding | 42 | 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
... | json_data | assert | variable | test/contrib/emscripten/test_emscripten.py | test_fn | 692 | 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... | 73 | assert | numeric_literal | test/with_dummyserver/test_socketlevel.py | test_multipart_assert_header_parsing_no_defects | TestMultipartResponse | 2,524 | 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... | [] | assert | collection | test/contrib/test_pyopenssl.py | test_get_subj_alt_name | TestPyOpenSSLHelpers | 101 | 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"... | f'filename="{expect}"' | assert | string_literal | test/test_fields.py | test_format_multipart_header_param | TestRequestField | 106 | null |
urllib3/urllib3 | from __future__ import annotations
import typing
import pytest
from urllib3._collections import HTTPHeaderDict
from urllib3._collections import RecentlyUsedContainer as Container
class TestLRUContainer:
def test_same_key(self) -> None:
d: Container[str, int] = Container(5)
for i in range(10):
... | 1 | assert | numeric_literal | test/test_collections.py | test_same_key | TestLRUContainer | 56 | 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... | 0 | assert | numeric_literal | test/with_dummyserver/test_proxy_poolmanager.py | test_nagle_proxy | TestHTTPProxyManager | 178 | 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... | 5 | assert | numeric_literal | test/test_response.py | test_readinto_with_memoryview | TestResponse | 1,113 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.fields import RequestField
from urllib3.filepost import _TYPE_FIELDS, encode_multipart_formdata
BOUNDARY = "!! test boundary !!"
BOUNDARY_BYTES = BOUNDARY.encode()
class TestMultipartEncoding:
@pytest.mark.parametrize(
"fields",
[
... | "multipart/form-data; boundary=" + str(BOUNDARY) | assert | string_literal | test/test_filepost.py | test_field_encoding | TestMultipartEncoding | 44 | 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(
"filename... | content_types | assert | variable | test/test_fields.py | test_guess_content_type | TestRequestField | 27 | 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... | 200 | assert | numeric_literal | test/contrib/test_socks.py | test_basic_request | TestSocks5Proxy | 276 | 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_make_multipart(self) -> None:
... | 'Content-Disposition: form-data; name="somename"\r\n' "Content-Type: image/jpg\r\n" "Content-Location: /test\r\n" "\r\n" | assert | string_literal | test/test_fields.py | test_make_multipart | TestRequestField | 42 | 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... | 10 | assert | numeric_literal | test/test_retry.py | test_retry_default | TestRetry | 84 | 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... | err.conn | assert | complex_expr | test/test_exceptions.py | test_pool_property_deprecation_warning | TestNewConnectionError | 83 | 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:
... | None | assert | none_literal | test/test_proxymanager.py | test_default_port | TestProxyManager | 46 | null |
urllib3/urllib3 | from __future__ import annotations
import pytest
from urllib3.fields import RequestField
from urllib3.filepost import _TYPE_FIELDS, encode_multipart_formdata
BOUNDARY = "!! test boundary !!"
BOUNDARY_BYTES = BOUNDARY.encode()
class TestMultipartEncoding:
@pytest.mark.parametrize(
"fields", [dict(k="v", ... | 3 | assert | numeric_literal | test/test_filepost.py | test_input_datastructures | TestMultipartEncoding | 18 | 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... | -1 | assert | numeric_literal | test/with_dummyserver/test_socketlevel.py | test_socket_close_socket_then_file | TestSocketClosing | 997 | 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... | signal.SIGALRM | assert | complex_expr | test/test_wait.py | handler | 112 | 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 ... | mock.ANY) | assert_* | complex_expr | test/test_ssltransport.py | test_constructor_params | TestSSLTransportWithMock | 529 | 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... | 1 | assert | numeric_literal | test/test_connectionpool.py | test_max_connections | TestConnectionPool | 230 | 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 ... | hex(len(chunk))[2:].encode("utf-8") | assert | func_call | test/with_dummyserver/test_chunked_transfer.py | test_chunks | TestChunkedTransfer | 59 | null |
urllib3/urllib3 | from __future__ import annotations
import typing
import pytest
from urllib3._collections import HTTPHeaderDict
from urllib3._collections import RecentlyUsedContainer as Container
class TestLRUContainer:
def test_maxsize(self) -> None:
d: Container[int, str] = Container(5)
for i in range(5):
... | 5 | assert | numeric_literal | test/test_collections.py | test_maxsize | TestLRUContainer | 18 | 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_create(self) -> None:
sim... | "Content-Length: 4\r\n\r\n" | assert | string_literal | test/test_fields.py | test_create | TestRequestField | 37 | 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... | 8 | assert | numeric_literal | test/test_response.py | test_multiple_chunks | TestBytesQueueBuffer | 98 | 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... | expected_result | assert | variable | test/contrib/test_pyopenssl.py | test_dnsname_to_stdlib_simple | TestPyOpenSSLHelpers | 70 | 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_ssl_version_with_protocol_tls_or_client_not_deprecated | BaseTestHTTPS | 865 | 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
... | context | assert | variable | test/test_ssl.py | test_create_urllib3_context_set_ciphers | TestSSL | 57 | 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... | True | assert | bool_literal | test/with_dummyserver/test_connection.py | test_connection_state_properties | 83 | 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... | Exception) | pytest.raises | variable | test/test_wait.py | test_wait_for_socket | 78 | 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
... | False | assert | bool_literal | test/contrib/emscripten/test_emscripten.py | should_return_false | 1,265 | 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... | str(e.value) | assert | func_call | test/test_connection.py | test_match_hostname_dns_with_brackets_doesnt_match | TestConnection | 191 | 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 ... | "" | assert | string_literal | test/test_ssltransport.py | validate_peercert | 93 | 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"0\r\n\r\n" | assert | string_literal | test/with_dummyserver/test_chunked_transfer.py | _test_body | TestChunkedTransfer | 94 | 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... | expected_value_bytes | assert | variable | dummyserver/testcase.py | assert_header_received | SocketDummyServerTestCase | 169 | 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... | 1 | assert | numeric_literal | test/with_dummyserver/test_proxy_poolmanager.py | test_proxy_pooling | TestHTTPProxyManager | 465 | 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
... | 200 | assert | numeric_literal | test/contrib/emscripten/test_emscripten.py | test_fn | 687 | 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... | conn2 | assert | variable | test/test_poolmanager.py | test_same_url | TestPoolManager | 31 | 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:
... | ProxyError) | pytest.raises | variable | test/test_proxymanager.py | test_proxy_connect_retry | TestProxyManager | 77 | 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 ... | 2 | assert | numeric_literal | test/with_dummyserver/test_chunked_transfer.py | test_preserve_chunked_on_retry_after | TestChunkedTransfer | 275 | null |
urllib3/urllib3 | from __future__ import annotations
import sys
from test import ImportBlocker, ModuleStash
import pytest
ssl_blocker = ImportBlocker("ssl", "_ssl")
module_stash = ModuleStash("urllib3")
class TestImportWithoutSSL(TestWithoutSSL):
def test_cannot_import_ssl(self) -> None:
with pytest.raises( | ImportError) | pytest.raises | variable | test/test_no_ssl.py | test_cannot_import_ssl | TestImportWithoutSSL | 36 | 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... | U.url | assert | complex_expr | test/test_util.py | test_Url_str | TestUtil | 359 | 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"user-agent: test-agent" | assert | string_literal | test/with_dummyserver/test_chunked_transfer.py | test_preserve_user_agent_header | TestChunkedTransfer | 203 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.