httpdbg 2.1.8__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {httpdbg-2.1.8 → httpdbg-2.2.0}/PKG-INFO +1 -1
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/__init__.py +1 -1
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/args.py +17 -4
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg.egg-info/PKG-INFO +1 -1
- httpdbg-2.2.0/tests/test_cli.py +32 -0
- httpdbg-2.1.8/tests/test_cli.py +0 -13
- {httpdbg-2.1.8 → httpdbg-2.2.0}/LICENSE +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/README.md +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/__main__.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/env.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/exception.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/export.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/__init__.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/aiohttp.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/all.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/external.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/fastapi.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/flask.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/generic.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/h2.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/http.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/httpx.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/pytest.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/record.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/recordhttp1.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/recordhttp2.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/requests.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/socket.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/starlette.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/template_sitecustomize.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/unittest.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/urllib3.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/utils.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/hooks/uvicorn.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/http_status_code.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/initiator.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/log.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/mode_console.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/mode_module.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/mode_script.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/preview.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/records.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/server.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/utils.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/__init__.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/api.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/app.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/api.js +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/column.css +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/configuration.css +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/configuration.js +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/detail.css +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/favicon.ico +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/filter.js +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/chevron-direction-top-outline-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/download-install-line-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/engine-gears-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/eye-blind-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/eye-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/files-papers-outline-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/filter-outline-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/lock-line-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/lock-open-line-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/math-multiplication-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/push-pin-green-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/question-mark-round-line-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/recycle-bin-line-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/wait-sandclock-icon.svg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/index.htm +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/main.js +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/mustache.min.js +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/render.js +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/style.css +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/table.css +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg.egg-info/SOURCES.txt +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg.egg-info/dependency_links.txt +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg.egg-info/entry_points.txt +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg.egg-info/top_level.txt +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/pyproject.toml +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/setup.cfg +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_api.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_context_manager.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_hook_aiohttp.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_hook_h2.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_hook_httpx.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_hook_pytest.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_hook_requests.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_hook_unittest.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_hook_urllib3.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_initiator.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_mode_console.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_mode_module_pytest.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_mode_script.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_multiprocess.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_preview.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_pyhttpdbg_server.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_server.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_server_hook_fastapi.py +0 -0
- {httpdbg-2.1.8 → httpdbg-2.2.0}/tests/test_server_hook_flask.py +0 -0
|
@@ -5,12 +5,25 @@ from httpdbg.log import LogLevel
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
def read_args(args: list[str]) -> tuple[argparse.Namespace, list[str]]:
|
|
8
|
+
"""
|
|
9
|
+
Parse the raw command-line arguments to separate the arguments intended
|
|
10
|
+
for httpdbg from those intended for the script or module being executed.
|
|
11
|
+
|
|
12
|
+
The httpdbg arguments are everything up to and including the selected
|
|
13
|
+
execution option (e.g. ``--script``, ``--module``, or ``-m``), while the
|
|
14
|
+
remaining arguments are passed to the target script or module.
|
|
15
|
+
"""
|
|
8
16
|
httpdbg_args = args
|
|
9
17
|
client_args = []
|
|
10
|
-
for
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
for arg in args:
|
|
19
|
+
tostop = False
|
|
20
|
+
for action in ["--console", "--module", "-m", "--script"]:
|
|
21
|
+
if action == arg:
|
|
22
|
+
httpdbg_args = args[: args.index(action) + 2]
|
|
23
|
+
client_args = args[args.index(action) + 1 :]
|
|
24
|
+
tostop = True
|
|
25
|
+
break
|
|
26
|
+
if tostop:
|
|
14
27
|
break
|
|
15
28
|
|
|
16
29
|
parser = argparse.ArgumentParser(
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from httpdbg import __version__
|
|
4
|
+
from httpdbg.__main__ import pyhttpdbg_entry_point
|
|
5
|
+
from httpdbg.args import read_args
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@pytest.mark.cli
|
|
9
|
+
def test_cli_version(monkeypatch, capsys):
|
|
10
|
+
monkeypatch.setattr("sys.argv", ["pyhttpdb", "--version"])
|
|
11
|
+
|
|
12
|
+
pyhttpdbg_entry_point(test_mode=True)
|
|
13
|
+
|
|
14
|
+
assert __version__ in capsys.readouterr().out.strip()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@pytest.mark.cli
|
|
18
|
+
def test_read_args_split_httpdbg_and_script_args():
|
|
19
|
+
"""Split httpdbg arguments from the arguments passed to the script/module."""
|
|
20
|
+
httpdbg_args_parsed, client_args = read_args(
|
|
21
|
+
["--port", "345", "--script", "demo.py", "--script", "xyz"]
|
|
22
|
+
)
|
|
23
|
+
assert httpdbg_args_parsed.port == 345
|
|
24
|
+
assert httpdbg_args_parsed.script == "demo.py"
|
|
25
|
+
assert client_args == ["demo.py", "--script", "xyz"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@pytest.mark.cli
|
|
29
|
+
def test_read_args_split_httpdbg_and_script_args_same_args():
|
|
30
|
+
"""Allow script/module arguments to reuse httpdbg command-line same options."""
|
|
31
|
+
read_args(["--script", "demo.py", "--script", "xyz"])
|
|
32
|
+
read_args(["--script", "demo.py", "-m", "xyz"])
|
httpdbg-2.1.8/tests/test_cli.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
from httpdbg import __version__
|
|
4
|
-
from httpdbg.__main__ import pyhttpdbg_entry_point
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@pytest.mark.cli
|
|
8
|
-
def test_cli_version(monkeypatch, capsys):
|
|
9
|
-
monkeypatch.setattr("sys.argv", ["pyhttpdb", "--version"])
|
|
10
|
-
|
|
11
|
-
pyhttpdbg_entry_point(test_mode=True)
|
|
12
|
-
|
|
13
|
-
assert __version__ in capsys.readouterr().out.strip()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/chevron-direction-top-outline-icon.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{httpdbg-2.1.8 → httpdbg-2.2.0}/httpdbg/webapp/static/icons/question-mark-round-line-icon.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|