repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setting.py
test__create_dict
assert
collection
10
import pytest import tomlkit from pysen.pyproject_model import _get_descendant from pysen.setting import _create_dict, _traverse_toml def test__create_dict() -> None: assert _create_dict([]) == {} assert _create_dict(["foo"]) ==
{"foo": {}}
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setting.py
test__traverse_toml
pytest.raises
variable
21
import pytest import tomlkit from pysen.pyproject_model import _get_descendant from pysen.setting import _create_dict, _traverse_toml def test__traverse_toml() -> None: unordered_document = """ [tool.poetry] hoo=1 [build-system] foo=42 [tool.pysen-cli] bar=43 """ document = tomlkit...
ValueError)
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setting.py
test__create_dict
assert
collection
11
import pytest import tomlkit from pysen.pyproject_model import _get_descendant from pysen.setting import _create_dict, _traverse_toml def test__create_dict() -> None: assert _create_dict([]) == {} assert _create_dict(["foo"]) == {"foo": {}} assert _create_dict(["foo", "bar"]) ==
{"foo": {"bar": {}}}
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setting.py
test__create_dict
assert
collection
12
import pytest import tomlkit from pysen.pyproject_model import _get_descendant from pysen.setting import _create_dict, _traverse_toml def test__create_dict() -> None: assert _create_dict([]) == {} assert _create_dict(["foo"]) == {"foo": {}} assert _create_dict(["foo", "bar"]) == {"foo": {"bar": {}}} ...
{"foo": {"bar": {"baz": {}}}}
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setuptools.py
test__get_setuptool_user_options
assert
numeric_literal
20
import pathlib from unittest import mock import setuptools import setuptools.command.build_py from pysen.setuptools import ( _PREDEFINED_COMMAND_NAMES, _create_setuptool_command, _get_setuptool_command, _get_setuptool_user_options, ) FAKE_PATH = pathlib.Path(__file__).resolve().parent def test__get_...
0
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setuptools.py
test__get_setuptool_user_options
assert
collection
24
import pathlib from unittest import mock import setuptools import setuptools.command.build_py from pysen.setuptools import ( _PREDEFINED_COMMAND_NAMES, _create_setuptool_command, _get_setuptool_command, _get_setuptool_user_options, ) FAKE_PATH = pathlib.Path(__file__).resolve().parent def test__get_...
[]
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setuptools.py
test__get_setuptool_command
assert
none_literal
38
import pathlib from unittest import mock import setuptools import setuptools.command.build_py from pysen.setuptools import ( _PREDEFINED_COMMAND_NAMES, _create_setuptool_command, _get_setuptool_command, _get_setuptool_user_options, ) FAKE_PATH = pathlib.Path(__file__).resolve().parent def test__get_...
None
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setuptools.py
test__get_setuptool_command
assert
variable
35
import pathlib from unittest import mock import setuptools import setuptools.command.build_py from pysen.setuptools import ( _PREDEFINED_COMMAND_NAMES, _create_setuptool_command, _get_setuptool_command, _get_setuptool_user_options, ) FAKE_PATH = pathlib.Path(__file__).resolve().parent def test__get_...
abstract_run
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setuptools.py
test__get_setuptool_command
assert
variable
33
import pathlib from unittest import mock import setuptools import setuptools.command.build_py from pysen.setuptools import ( _PREDEFINED_COMMAND_NAMES, _create_setuptool_command, _get_setuptool_command, _get_setuptool_user_options, ) FAKE_PATH = pathlib.Path(__file__).resolve().parent def test__get_...
abstract_init_opt
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setuptools.py
test__get_setuptool_command
assert
complex_expr
40
import pathlib from unittest import mock import setuptools import setuptools.command.build_py from pysen.setuptools import ( _PREDEFINED_COMMAND_NAMES, _create_setuptool_command, _get_setuptool_command, _get_setuptool_user_options, ) FAKE_PATH = pathlib.Path(__file__).resolve().parent def test__get_...
setuptools.Command
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_setuptools.py
test__create_setuptool_command_inheritance
assert
complex_expr
23
import pathlib from unittest import mock import setuptools import setuptools.command.build_py from pysen.setuptools import ( _PREDEFINED_COMMAND_NAMES, _create_setuptool_command, _get_setuptool_command, _get_setuptool_user_options, ) FAKE_PATH = pathlib.Path(__file__).resolve().parent def test__crea...
setuptools.command.build_py.build_py
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_source.py
test__resolve
assert
numeric_literal
57
import contextlib import pathlib import tempfile from typing import Iterator, Set import git import pytest import tomlkit from pysen.path import change_dir from pysen.source import ( PythonFileFilter, Source, SourceEntrySetting, _resolve, extension_filter, ) BASE_DIR = pathlib.Path(__file__).reso...
1
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_source.py
test__resolve
assert
numeric_literal
72
import contextlib import pathlib import tempfile from typing import Iterator, Set import git import pytest import tomlkit from pysen.path import change_dir from pysen.source import ( PythonFileFilter, Source, SourceEntrySetting, _resolve, extension_filter, ) BASE_DIR = pathlib.Path(__file__).reso...
0
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_source.py
test__resolve
assert
variable
80
import contextlib import pathlib import tempfile from typing import Iterator, Set import git import pytest import tomlkit from pysen.path import change_dir from pysen.source import ( PythonFileFilter, Source, SourceEntrySetting, _resolve, extension_filter, ) BASE_DIR = pathlib.Path(__file__).reso...
str
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_source.py
test_copy
assert
collection
67
import contextlib import pathlib import tempfile from typing import Iterator, Set import git import pytest import tomlkit from pysen.path import change_dir from pysen.source import ( PythonFileFilter, Source, SourceEntrySetting, _resolve, extension_filter, ) BASE_DIR = pathlib.Path(__file__).reso...
{"piyo"}
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_source.py
test_add_remove
pytest.raises
variable
25
import contextlib import pathlib import tempfile from typing import Iterator, Set import git import pytest import tomlkit from pysen.path import change_dir from pysen.source import ( PythonFileFilter, Source, SourceEntrySetting, _resolve, extension_filter, ) BASE_DIR = pathlib.Path(__file__).reso...
KeyError)
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_source.py
test_copy
assert
complex_expr
52
import contextlib import pathlib import tempfile from typing import Iterator, Set import git import pytest import tomlkit from pysen.path import change_dir from pysen.source import ( PythonFileFilter, Source, SourceEntrySetting, _resolve, extension_filter, ) BASE_DIR = pathlib.Path(__file__).reso...
copied.includes
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_source.py
test_copy
assert
complex_expr
54
import contextlib import pathlib import tempfile from typing import Iterator, Set import git import pytest import tomlkit from pysen.path import change_dir from pysen.source import ( PythonFileFilter, Source, SourceEntrySetting, _resolve, extension_filter, ) BASE_DIR = pathlib.Path(__file__).reso...
copied.excludes
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pfnet/pysen
f9694670924687b864384c87858ec70dc3fb6402
10
train
train
tests/test_source.py
test_resolve_files_root_dot
assert
variable
78
import contextlib import pathlib import tempfile from typing import Iterator, Set import git import pytest import tomlkit from pysen.path import change_dir from pysen.source import ( PythonFileFilter, Source, SourceEntrySetting, _resolve, extension_filter, ) BASE_DIR = pathlib.Path(__file__).reso...
expected_tracked
f9694670924687b864384c87858ec70dc3fb6402
10
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_lifespan.py
test_startup_timeout_error
pytest.raises
variable
26
from __future__ import annotations import asyncio from time import sleep from typing import Callable import pytest from hypercorn.asyncio.lifespan import Lifespan from hypercorn.config import Config from hypercorn.typing import Scope from hypercorn.utils import LifespanFailureError, LifespanTimeoutError from ..helpe...
LifespanTimeoutError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_lifespan.py
test_startup_failure
assert
string_literal
28
from __future__ import annotations import asyncio from time import sleep from typing import Callable import pytest from hypercorn.asyncio.lifespan import Lifespan from hypercorn.config import Config from hypercorn.typing import Scope from hypercorn.utils import LifespanFailureError, LifespanTimeoutError from ..helpe...
"Lifespan failure in startup. 'Failure'"
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_sanity.py
test_http1_websocket
assert
collection
40
from __future__ import annotations import asyncio import h2 import h11 import pytest import wsproto from hypercorn.asyncio.tcp_server import TCPServer from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from .helpers import MemoryReader, MemoryWriter from ..helpers import S...
[wsproto.events.TextMessage(data="Hello & Goodbye")]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_sanity.py
test_http1_websocket
assert
collection
43
from __future__ import annotations import asyncio import h2 import h11 import pytest import wsproto from hypercorn.asyncio.tcp_server import TCPServer from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from .helpers import MemoryReader, MemoryWriter from ..helpers import S...
[wsproto.events.CloseConnection(code=1000, reason="")]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_sanity.py
test_http2_websocket
assert
collection
48
from __future__ import annotations import asyncio import h2 import h11 import pytest import wsproto from hypercorn.asyncio.tcp_server import TCPServer from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from .helpers import MemoryReader, MemoryWriter from ..helpers import S...
[ (b":status", b"200"), (b"date", b"Thu, 01 Jan 1970 01:23:20 GMT"), (b"server", b"hypercorn-h2"), ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_sanity.py
test_http2_request
assert
collection
66
from __future__ import annotations import asyncio import h2 import h11 import pytest import wsproto from hypercorn.asyncio.tcp_server import TCPServer from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from .helpers import MemoryReader, MemoryWriter from ..helpers import S...
[ (b":status", b"200"), (b"content-length", b"15"), (b"date", b"Thu, 01 Jan 1970 01:23:20 GMT"), (b"server", b"hypercorn-h2"), ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_sanity.py
test_http1_websocket
assert
collection
28
from __future__ import annotations import asyncio import h2 import h11 import pytest import wsproto from hypercorn.asyncio.tcp_server import TCPServer from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from .helpers import MemoryReader, MemoryWriter from ..helpers import S...
[ wsproto.events.AcceptConnection( extra_headers=[ (b"date", b"Thu, 01 Jan 1970 01:23:20 GMT"), (b"server", b"hypercorn-h11"), ] ) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_sanity.py
test_http1_request
assert
collection
50
from __future__ import annotations import asyncio import h2 import h11 import pytest import wsproto from hypercorn.asyncio.tcp_server import TCPServer from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from .helpers import MemoryReader, MemoryWriter from ..helpers import S...
[ h11.Response( status_code=200, headers=[ (b"content-length", b"15"), (b"date", b"Thu, 01 Jan 1970 01:23:20 GMT"), (b"server", b"hypercorn-h11"), (b"connection", b"close"), ], http_version=b"1.1", reason=b"", ), h11.Data(data=b"Hello & Goodbye"), h11.EndOfMessage(headers=[]), # type: ignore ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_task_group.py
test_spawn_app_error
assert
none_literal
23
from __future__ import annotations import asyncio from typing import Callable import pytest from hypercorn.asyncio.task_group import TaskGroup from hypercorn.config import Config from hypercorn.typing import HTTPScope, Scope @pytest.mark.asyncio async def test_spawn_app_error( event_loop: asyncio.AbstractEventL...
None
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_task_group.py
test_spawn_app_cancelled
pytest.raises
complex_expr
21
from __future__ import annotations import asyncio from typing import Callable import pytest from hypercorn.asyncio.task_group import TaskGroup from hypercorn.config import Config from hypercorn.typing import HTTPScope, Scope @pytest.mark.asyncio async def test_spawn_app_cancelled( event_loop: asyncio.AbstractEv...
asyncio.CancelledError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_task_group.py
test_spawn_app
assert
collection
26
from __future__ import annotations import asyncio from typing import Callable import pytest from hypercorn.asyncio.task_group import TaskGroup from hypercorn.config import Config from hypercorn.typing import HTTPScope, Scope @pytest.mark.asyncio async def test_spawn_app(event_loop: asyncio.AbstractEventLoop, http_s...
{"type": "http.disconnect"}
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/asyncio/test_tcp_server.py
test_complets_on_half_close
assert
string_literal
24
from __future__ import annotations import asyncio import pytest from hypercorn.asyncio.tcp_server import TCPServer from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from .helpers import MemoryReader, MemoryWriter from ..helpers import echo_framework @pytest.mark.asyncio ...
b"HTTP/1.1 200 \r\ncontent-length: 335\r\ndate: Thu, 01 Jan 1970 01:23:20 GMT\r\nserver: hypercorn-h11\r\n\r\n"
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/helpers.py
sanity_framework
assert
variable
73
from __future__ import annotations from copy import deepcopy from json import dumps from socket import AF_INET from typing import Callable, cast, Tuple from hypercorn.typing import Scope, WWWScope SANITY_BODY = b"Hello Hypercorn" async def empty_framework(scope: Scope, receive: Callable, send: Callable) -> None: ...
SANITY_BODY
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_dispatcher.py
test_asyncio_dispatcher_lifespan
assert
collection
27
from __future__ import annotations from typing import Callable, cast import pytest from hypercorn.middleware.dispatcher import AsyncioDispatcherMiddleware, TrioDispatcherMiddleware from hypercorn.typing import HTTPScope, Scope @pytest.mark.asyncio async def test_asyncio_dispatcher_lifespan() -> None: app = Asyn...
[{"type": "lifespan.startup.complete"}]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_dispatcher.py
test_dispatcher_middleware
assert
collection
42
from __future__ import annotations from typing import Callable, cast import pytest from hypercorn.middleware.dispatcher import AsyncioDispatcherMiddleware, TrioDispatcherMiddleware from hypercorn.typing import HTTPScope, Scope @pytest.mark.asyncio async def test_dispatcher_middleware(http_scope: HTTPScope) -> None:...
[ {"type": "http.response.start", "status": 200, "headers": [(b"content-length", b"7")]}, {"type": "http.response.body", "body": b"apix-/b"}, {"type": "http.response.start", "status": 200, "headers": [(b"content-length", b"6")]}, {"type": "http.response.body", "body": b"api-/b"}, {"type": "http.response.start", "status...
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_http_to_https.py
test_http_to_https_redirect_new_url_header
assert
string_literal
30
from __future__ import annotations import pytest from hypercorn.middleware import HTTPToHTTPSRedirectMiddleware from hypercorn.typing import HTTPScope, WebsocketScope from ..helpers import empty_framework def test_http_to_https_redirect_new_url_header() -> None: app = HTTPToHTTPSRedirectMiddleware(empty_framewor...
"https://localhost/"
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_http_to_https.py
test_http_to_https_redirect_middleware_websocket_no_rejection
assert
collection
36
from __future__ import annotations import pytest from hypercorn.middleware import HTTPToHTTPSRedirectMiddleware from hypercorn.typing import HTTPScope, WebsocketScope from ..helpers import empty_framework @pytest.mark.asyncio async def test_http_to_https_redirect_middleware_websocket_no_rejection() -> None: app ...
[{"type": "websocket.close"}]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_http_to_https.py
test_http_to_https_redirect_middleware_http
assert
collection
38
from __future__ import annotations import pytest from hypercorn.middleware import HTTPToHTTPSRedirectMiddleware from hypercorn.typing import HTTPScope, WebsocketScope from ..helpers import empty_framework @pytest.mark.asyncio @pytest.mark.parametrize("raw_path", [b"/abc", b"/abc%3C"]) async def test_http_to_https_re...
[ { "type": "http.response.start", "status": 307, "headers": [(b"location", b"https://localhost%s?a=b" % raw_path)], }, {"type": "http.response.body"}, ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_http_to_https.py
test_http_to_https_redirect_middleware_websocket_http2
assert
collection
36
from __future__ import annotations import pytest from hypercorn.middleware import HTTPToHTTPSRedirectMiddleware from hypercorn.typing import HTTPScope, WebsocketScope from ..helpers import empty_framework @pytest.mark.asyncio async def test_http_to_https_redirect_middleware_websocket_http2() -> None: app = HTTPT...
[ { "type": "websocket.http.response.start", "status": 307, "headers": [(b"location", b"https://localhost/abc?a=b")], }, {"type": "websocket.http.response.body"}, ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_http_to_https.py
test_http_to_https_redirect_middleware_websocket
assert
collection
37
from __future__ import annotations import pytest from hypercorn.middleware import HTTPToHTTPSRedirectMiddleware from hypercorn.typing import HTTPScope, WebsocketScope from ..helpers import empty_framework @pytest.mark.asyncio @pytest.mark.parametrize("raw_path", [b"/abc", b"/abc%3C"]) async def test_http_to_https_re...
[ { "type": "websocket.http.response.start", "status": 307, "headers": [(b"location", b"wss://localhost%s?a=b" % raw_path)], }, {"type": "websocket.http.response.body"}, ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_wsgi.py
test_build_environ_root_path
pytest.raises
variable
40
from __future__ import annotations import asyncio from typing import Callable, List import pytest import trio from hypercorn.middleware import AsyncioWSGIMiddleware, TrioWSGIMiddleware from hypercorn.middleware.wsgi import _build_environ, InvalidPathError from hypercorn.typing import HTTPScope def echo_body(environ...
InvalidPathError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_wsgi.py
test_build_environ_encoding
assert
string_literal
41
from __future__ import annotations import asyncio from typing import Callable, List import pytest import trio from hypercorn.middleware import AsyncioWSGIMiddleware, TrioWSGIMiddleware from hypercorn.middleware.wsgi import _build_environ, InvalidPathError from hypercorn.typing import HTTPScope def echo_body(environ...
"/中".encode("utf8").decode("latin-1")
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_wsgi.py
test_build_environ_encoding
assert
string_literal
42
from __future__ import annotations import asyncio from typing import Callable, List import pytest import trio from hypercorn.middleware import AsyncioWSGIMiddleware, TrioWSGIMiddleware from hypercorn.middleware.wsgi import _build_environ, InvalidPathError from hypercorn.typing import HTTPScope def echo_body(environ...
"/文".encode("utf8").decode("latin-1")
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_wsgi.py
test_max_body_size
assert
collection
51
from __future__ import annotations import asyncio from typing import Callable, List import pytest import trio from hypercorn.middleware import AsyncioWSGIMiddleware, TrioWSGIMiddleware from hypercorn.middleware.wsgi import _build_environ, InvalidPathError from hypercorn.typing import HTTPScope def echo_body(environ...
[ {"headers": [], "status": 400, "type": "http.response.start"}, {"body": bytearray(b""), "type": "http.response.body"}, ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/middleware/test_wsgi.py
test_wsgi_trio
assert
collection
52
from __future__ import annotations import asyncio from typing import Callable, List import pytest import trio from hypercorn.middleware import AsyncioWSGIMiddleware, TrioWSGIMiddleware from hypercorn.middleware.wsgi import _build_environ, InvalidPathError from hypercorn.typing import HTTPScope def echo_body(environ...
[ { "headers": [(b"content-type", b"text/plain; charset=utf-8"), (b"content-length", b"0")], "status": 200, "type": "http.response.start", }, {"body": bytearray(b""), "type": "http.response.body"}, ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_instant_recycle
assert
none_literal
46
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
None
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_h2c_upgrade
assert
string_literal
57
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
b"bbb"
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_h2c_upgrade
assert
string_literal
66
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
"abcd"
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_pipelining
pytest.raises
variable
37
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
Exception)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_send_stream_closed
assert
func_call
49
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
call(expected)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_h2_prior
pytest.raises
variable
36
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
H2ProtocolAssumedError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_h2c_upgrade
pytest.raises
variable
36
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
H2CProtocolRequiredError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_h2_prior
assert
string_literal
39
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
b"PRI * HTTP/2.0\r\n\r\nbbb"
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_send_data
assert
collection
38
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
[call(RawData(data=b"hello"))]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_continue_request
assert
func_call
49
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
RawData( # type: ignore data=b"HTTP/1.1 100 \r\ndate: Thu, 01 Jan 1970 01:23:20 GMT\r\nserver: hypercorn-h11\r\n\r\n" # noqa: E501 )
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_h2c_upgrade
assert
collection
58
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
[ (b":method", b"GET"), (b":path", b"/"), (b":authority", b"hypercorn"), (b"host", b"hypercorn"), (b"upgrade", b"h2c"), (b"http2-settings", b"abcd"), ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_send_response
assert
collection
38
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
[ # type: ignore call( RawData( data=( b"HTTP/1.1 201 \r\ndate: Thu, 01 Jan 1970 01:23:20 GMT\r\n" b"server: hypercorn-h11\r\nConnection: close\r\n\r\n" ) ) ) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_preserve_headers
assert
collection
40
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
[ # type: ignore call( RawData( data=( b"HTTP/1.1 201 \r\nX-Special: Value\r\n" b"date: Thu, 01 Jan 1970 01:23:20 GMT\r\n" b"server: hypercorn-h11\r\nConnection: close\r\n\r\n" ) ) ) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_h2c_upgrade
assert
collection
45
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
[ # type: ignore call( RawData( b"HTTP/1.1 101 \r\n" b"date: Thu, 01 Jan 1970 01:23:20 GMT\r\n" b"server: hypercorn-h11\r\n" b"connection: upgrade\r\n" b"upgrade: h2c\r\n" b"\r\n" ) ) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_request
assert
collection
41
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
[ # type: ignore call( Request( stream_id=1, headers=[(b"host", b"hypercorn"), (b"connection", b"close")], http_version="1.1", method="GET", raw_path=b"/?a=b", ) ), call(EndBody(stream_id=1)), ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h11.py
test_protocol_handle_protocol_error
assert
collection
38
from __future__ import annotations import asyncio from typing import Any from unittest.mock import call, Mock import h11 import pytest import pytest_asyncio from _pytest.monkeypatch import MonkeyPatch import hypercorn.protocol.h11 from hypercorn.asyncio.worker_context import EventWrapper from hypercorn.config import...
[ # type: ignore call( RawData( data=b"HTTP/1.1 400 \r\ncontent-length: 0\r\nconnection: close\r\n" b"date: Thu, 01 Jan 1970 01:23:20 GMT\r\nserver: hypercorn-h11\r\n\r\n" ) ), call(RawData(data=b"")), call(Closed()), ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h2.py
test_stream_buffer_push_and_pop
assert
bool_literal
27
from __future__ import annotations import asyncio from unittest.mock import call, Mock import pytest from hypercorn.asyncio.worker_context import EventWrapper, WorkerContext from hypercorn.config import Config from hypercorn.events import Closed, RawData from hypercorn.protocol.h2 import BUFFER_HIGH_WATER, BufferCom...
True
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h2.py
test_protocol_handle_protocol_error
assert
collection
21
from __future__ import annotations import asyncio from unittest.mock import call, Mock import pytest from hypercorn.asyncio.worker_context import EventWrapper, WorkerContext from hypercorn.config import Config from hypercorn.events import Closed, RawData from hypercorn.protocol.h2 import BUFFER_HIGH_WATER, BufferCom...
[call(Closed())]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_h2.py
test_stream_buffer_closed
pytest.raises
variable
21
from __future__ import annotations import asyncio from unittest.mock import call, Mock import pytest from hypercorn.asyncio.worker_context import EventWrapper, WorkerContext from hypercorn.config import Config from hypercorn.events import Closed, RawData from hypercorn.protocol.h2 import BUFFER_HIGH_WATER, BufferCom...
BufferCompleteError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_stream_idle
assert
bool_literal
34
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
False
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_send_response
assert
complex_expr
47
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
ASGIHTTPState.CLOSED
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_send_response
assert
complex_expr
41
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
ASGIHTTPState.REQUEST
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_send_invalid_message_given_state
pytest.raises
variable
47
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
UnexpectedMessageError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_send_invalid_message
pytest.raises
collection
51
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
(TypeError, ValueError))
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_handle_closed
assert
collection
37
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
[call({"type": "http.disconnect"})]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_handle_end_body
assert
collection
38
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
[ call({"type": "http.request", "body": b"", "more_body": False}) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_handle_body
assert
collection
37
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
[ # type: ignore call({"type": "http.request", "body": b"data", "more_body": True}) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_send_push
assert
collection
38
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
[ # type: ignore call( Request( stream_id=1, headers=[(b":scheme", b"https")], http_version="2", method="GET", raw_path=b"/push", ) ) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_send_early_hint
assert
collection
40
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
[ # type: ignore call( InformationalResponse( stream_id=1, headers=[(b"link", b'</style.css>; rel="preload"; as="style"')], status_code=103, ) ) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_invalid_server_name
assert
collection
45
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
[ # type: ignore call( Response( stream_id=1, headers=[(b"content-length", b"0"), (b"connection", b"close")], status_code=404, ) ), call(EndBody(stream_id=1)), ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_send_response
assert
collection
49
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
[ # type: ignore call(Response(stream_id=1, headers=[], status_code=200)), call(Body(stream_id=1, data=b"Body")), call(EndBody(stream_id=1)), call(StreamClosed(stream_id=1)), ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_send_app_error
assert
collection
40
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
[ # type: ignore call( Response( stream_id=1, headers=[(b"content-length", b"0"), (b"connection", b"close")], status_code=500, ) ), call(EndBody(stream_id=1)), call(StreamClosed(stream_id=1)), ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_handle_request_http_1
assert
collection
41
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
{ "type": "http", "http_version": http_version, "asgi": {"spec_version": "2.1"}, "method": "GET", "scheme": "http", "path": "/", "raw_path": b"/", "query_string": b"a=b", "root_path": stream.config.root_path, "headers": [], "client": None, "server": None, "extensions": {}, }
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_http_stream.py
test_handle_request_http_2
assert
collection
40
from __future__ import annotations from typing import Any, cast from unittest.mock import call import pytest import pytest_asyncio from hypercorn.asyncio.worker_context import WorkerContext from hypercorn.config import Config from hypercorn.logging import Logger from hypercorn.protocol.events import ( Body, ...
{ "type": "http", "http_version": "2", "asgi": {"spec_version": "2.1"}, "method": "GET", "scheme": "http", "path": "/", "raw_path": b"/", "query_string": b"a=b", "root_path": stream.config.root_path, "headers": [], "client": None, "server": None, "extensions": {"http.response.early_hint": {}, "http.response.push": {}},...
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_handshake_accept_http2
assert
collection
37
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
[]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_handshake_accept_http1
assert
numeric_literal
44
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
101
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_handshake_accept_http2
assert
numeric_literal
36
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
200
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_stream_idle
assert
variable
53
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
idle
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_handshake_validity
assert
variable
75
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
valid
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_buffer_mixed_types
pytest.raises
variable
49
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
TypeError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_buffer_frame_too_large
pytest.raises
variable
35
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
FrameTooLargeError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_send_invalid_message_given_state
pytest.raises
variable
60
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
UnexpectedMessageError)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_send_invalid_http_message
pytest.raises
collection
57
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
(TypeError, ValueError))
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_send_accept
assert
complex_expr
54
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
ASGIWebsocketState.CONNECTED
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_send_reject
assert
complex_expr
59
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
ASGIWebsocketState.HANDSHAKE
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_send_reject
assert
complex_expr
65
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
ASGIWebsocketState.HTTPCLOSED
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_closure
assert
collection
51
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
[call({"type": "websocket.disconnect", "code": 1006})]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_buffer
assert
collection
36
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
{"type": "websocket.receive", "bytes": None, "text": "abc"}
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_buffer
assert
collection
39
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
{"type": "websocket.receive", "bytes": b"abc", "text": None}
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_handle_connection
assert
collection
57
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
[ call({"type": "websocket.receive", "bytes": None, "text": "hello"}) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_handle_closed
assert
collection
46
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
[ # type: ignore call({"type": "websocket.disconnect", "code": 1006}) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/protocol/test_ws_stream.py
test_send_accept
assert
collection
56
from __future__ import annotations import asyncio from typing import Any, cast, List, Tuple from unittest.mock import call, Mock import pytest import pytest_asyncio from wsproto.events import BytesMessage, TextMessage from hypercorn.asyncio.task_group import TaskGroup from hypercorn.asyncio.worker_context import Wor...
[ # type: ignore call(Response(stream_id=1, headers=[], status_code=200)) ]
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/test___main__.py
test_main_cli_override
assert
variable
49
from __future__ import annotations import inspect import os from unittest.mock import Mock import pytest from _pytest.monkeypatch import MonkeyPatch import hypercorn.__main__ from hypercorn.config import Config @pytest.mark.parametrize( "flag, set_value, config_key", [ ("--access-logformat", "jeff",...
set_value
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/test___main__.py
test_verify_mode_conversion
pytest.raises
variable
18
from __future__ import annotations import inspect import os from unittest.mock import Mock import pytest from _pytest.monkeypatch import MonkeyPatch import hypercorn.__main__ from hypercorn.config import Config def test_verify_mode_conversion(monkeypatch: MonkeyPatch) -> None: run_multiple = Mock() monkeypa...
SystemExit)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/test___main__.py
test_main_cli_override
assert
func_call
48
from __future__ import annotations import inspect import os from unittest.mock import Mock import pytest from _pytest.monkeypatch import MonkeyPatch import hypercorn.__main__ from hypercorn.config import Config @pytest.mark.parametrize( "flag, set_value, config_key", [ ("--access-logformat", "jeff",...
getattr(config, name)
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor
pgjones/hypercorn
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
train
train
tests/test_config.py
test_create_sockets_multiple
assert
numeric_literal
32
from __future__ import annotations import os import socket import ssl import sys from typing import Tuple from unittest.mock import Mock, NonCallableMock import pytest from _pytest.monkeypatch import MonkeyPatch import hypercorn.config from hypercorn.config import Config access_log_format = "bob" h11_max_incomplete...
2
dbe00077590887ea8e1405aef24e5e4ff70df17d
150
v2_extractor_at_anchor