csu 2.6.5__tar.gz → 2.6.6__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.
- {csu-2.6.5 → csu-2.6.6}/.bumpversion.cfg +1 -1
- {csu-2.6.5 → csu-2.6.6}/.cookiecutterrc +1 -1
- {csu-2.6.5 → csu-2.6.6}/PKG-INFO +3 -3
- {csu-2.6.5 → csu-2.6.6}/README.rst +2 -2
- {csu-2.6.5 → csu-2.6.6}/pyproject.toml +1 -1
- {csu-2.6.5 → csu-2.6.6}/src/csu/__init__.py +1 -1
- {csu-2.6.5 → csu-2.6.6}/src/csu/exceptions.py +2 -2
- {csu-2.6.5 → csu-2.6.6}/src/csu/test_service.py +0 -9
- {csu-2.6.5 → csu-2.6.6}/src/csu.egg-info/PKG-INFO +3 -3
- {csu-2.6.5 → csu-2.6.6}/src/csu.egg-info/SOURCES.txt +1 -1
- {csu-2.6.5/src/csu → csu-2.6.6/tests}/test_exceptions.py +32 -19
- {csu-2.6.5 → csu-2.6.6}/tests/test_service.py +36 -36
- {csu-2.6.5 → csu-2.6.6}/tests/test_service_auth.py +12 -12
- csu-2.6.6/tests/test_views.py +107 -0
- csu-2.6.5/tests/test_views.py +0 -90
- {csu-2.6.5 → csu-2.6.6}/.coveragerc +0 -0
- {csu-2.6.5 → csu-2.6.6}/.editorconfig +0 -0
- {csu-2.6.5 → csu-2.6.6}/.github/workflows/github-actions.yml +0 -0
- {csu-2.6.5 → csu-2.6.6}/.pre-commit-config.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/.tombi.toml +0 -0
- {csu-2.6.5 → csu-2.6.6}/AUTHORS.rst +0 -0
- {csu-2.6.5 → csu-2.6.6}/CHANGELOG.rst +0 -0
- {csu-2.6.5 → csu-2.6.6}/CONTRIBUTING.rst +0 -0
- {csu-2.6.5 → csu-2.6.6}/LICENSE +0 -0
- {csu-2.6.5 → csu-2.6.6}/MANIFEST.in +0 -0
- {csu-2.6.5 → csu-2.6.6}/ci/bootstrap.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/ci/requirements.txt +0 -0
- {csu-2.6.5 → csu-2.6.6}/ci/templates/.github/workflows/github-actions.yml +0 -0
- {csu-2.6.5 → csu-2.6.6}/pytest.ini +0 -0
- {csu-2.6.5 → csu-2.6.6}/setup.cfg +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/admin.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/conf.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/consts.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/__init__.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/auth.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/fields.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/forms.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/perms.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/phonenumber.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/serializers.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/test_auth.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/test_fields.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/test_forms.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/test_phonenumber.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/test_serializers.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/drf/views.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/enums.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/env.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/export.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/fixups.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/forms/__init__.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/forms/crispy.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/forms/fields.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/gettext.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/gettext_lazy.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/locale/ro/LC_MESSAGES/django.mo +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/locale/ro/LC_MESSAGES/django.po +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/logging.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/management.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/models.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/query.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/routers.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/service.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/templates/api_exception.html +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/templates/forms/widgets/opaquewidget.html +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/test_consts.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/test_env.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/test_management.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/test_timezones.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/test_utils.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/test_xml.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/timezones.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/utils.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/views.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/worker/__init__.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/worker/admin.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/worker/asgi.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/worker/engine.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/worker/enums.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/worker/job.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/worker/models.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/worker/registry.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/wsgi.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu/xml.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu.egg-info/dependency_links.txt +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu.egg-info/requires.txt +0 -0
- {csu-2.6.5 → csu-2.6.6}/src/csu.egg-info/top_level.txt +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service/test_custom_context.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service/test_custom_context_0_retries.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service/test_decoding.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service/test_error.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service/test_logging.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service/test_redirects.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service_auth/test_async.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service_auth/test_async_auth.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service_auth/test_sync.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/cassettes/test_service_auth/test_sync_auth.yaml +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/conftest.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/exampleworker.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/test_exampleworker.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/test_logging.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/test_models.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/test_worker.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/testproject/__init__.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/testproject/fixtures/testuser.json +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/testproject/models.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/testproject/settings.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tests/testproject/urls.py +0 -0
- {csu-2.6.5 → csu-2.6.6}/tox.ini +0 -0
{csu-2.6.5 → csu-2.6.6}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: csu
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.6
|
|
4
4
|
Summary: Clean Slate Utils - bunch of utility code, mostly Django/DRF specific.
|
|
5
5
|
Author-email: Ionel Cristian Mărieș <contact@ionelmc.ro>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -69,9 +69,9 @@ Overview
|
|
|
69
69
|
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/csu.svg
|
|
70
70
|
:alt: Supported implementations
|
|
71
71
|
:target: https://pypi.org/project/csu
|
|
72
|
-
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.
|
|
72
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.6.svg
|
|
73
73
|
:alt: Commits since latest release
|
|
74
|
-
:target: https://github.com/ionelmc/python-csu/compare/v2.6.
|
|
74
|
+
:target: https://github.com/ionelmc/python-csu/compare/v2.6.6...main
|
|
75
75
|
.. |scrutinizer| image:: https://img.shields.io/scrutinizer/quality/g/ionelmc/python-csu/main.svg
|
|
76
76
|
:alt: Scrutinizer Status
|
|
77
77
|
:target: https://scrutinizer-ci.com/g/ionelmc/python-csu/
|
|
@@ -34,9 +34,9 @@ Overview
|
|
|
34
34
|
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/csu.svg
|
|
35
35
|
:alt: Supported implementations
|
|
36
36
|
:target: https://pypi.org/project/csu
|
|
37
|
-
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.
|
|
37
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.6.svg
|
|
38
38
|
:alt: Commits since latest release
|
|
39
|
-
:target: https://github.com/ionelmc/python-csu/compare/v2.6.
|
|
39
|
+
:target: https://github.com/ionelmc/python-csu/compare/v2.6.6...main
|
|
40
40
|
.. |scrutinizer| image:: https://img.shields.io/scrutinizer/quality/g/ionelmc/python-csu/main.svg
|
|
41
41
|
:alt: Scrutinizer Status
|
|
42
42
|
:target: https://scrutinizer-ci.com/g/ionelmc/python-csu/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from base64 import b64encode
|
|
1
2
|
from collections import Counter
|
|
2
3
|
from collections.abc import Iterable
|
|
3
4
|
from importlib.util import find_spec
|
|
@@ -23,8 +24,7 @@ else:
|
|
|
23
24
|
|
|
24
25
|
def get_event_id():
|
|
25
26
|
dt = now()
|
|
26
|
-
|
|
27
|
-
return dt.strftime(f"%y%m%d:{urandom(4).hex()}:%H%M{seconds.total_seconds():05.2f}")
|
|
27
|
+
return dt.strftime(f"%y%m%d:{b64encode(urandom(3)).strip(b'=').decode()}:%H%M%S")
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class TaggedError(Exception):
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
from typing import reveal_type
|
|
2
2
|
|
|
3
|
-
import time_machine
|
|
4
3
|
from niquests import PreparedRequest
|
|
5
4
|
from niquests import Response
|
|
6
5
|
|
|
7
|
-
from . import exceptions
|
|
8
|
-
from .exceptions import get_event_id
|
|
9
6
|
from .service import AsyncHTTPService
|
|
10
7
|
from .service import AsyncHTTPServiceContext
|
|
11
8
|
from .service import HTTPService
|
|
12
9
|
from .service import HTTPServiceContext
|
|
13
10
|
|
|
14
11
|
|
|
15
|
-
def test_get_accident_id(monkeypatch):
|
|
16
|
-
monkeypatch.setattr(exceptions, "urandom", lambda len: bytes(range(len)))
|
|
17
|
-
with time_machine.travel(1674777700.5816755):
|
|
18
|
-
assert get_event_id() == "230127:00010203:020140.58"
|
|
19
|
-
|
|
20
|
-
|
|
21
12
|
class CustomResponse:
|
|
22
13
|
def bar(self, x: float) -> float: ...
|
|
23
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: csu
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.6
|
|
4
4
|
Summary: Clean Slate Utils - bunch of utility code, mostly Django/DRF specific.
|
|
5
5
|
Author-email: Ionel Cristian Mărieș <contact@ionelmc.ro>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -69,9 +69,9 @@ Overview
|
|
|
69
69
|
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/csu.svg
|
|
70
70
|
:alt: Supported implementations
|
|
71
71
|
:target: https://pypi.org/project/csu
|
|
72
|
-
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.
|
|
72
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.6.svg
|
|
73
73
|
:alt: Commits since latest release
|
|
74
|
-
:target: https://github.com/ionelmc/python-csu/compare/v2.6.
|
|
74
|
+
:target: https://github.com/ionelmc/python-csu/compare/v2.6.6...main
|
|
75
75
|
.. |scrutinizer| image:: https://img.shields.io/scrutinizer/quality/g/ionelmc/python-csu/main.svg
|
|
76
76
|
:alt: Scrutinizer Status
|
|
77
77
|
:target: https://scrutinizer-ci.com/g/ionelmc/python-csu/
|
|
@@ -36,7 +36,6 @@ src/csu/routers.py
|
|
|
36
36
|
src/csu/service.py
|
|
37
37
|
src/csu/test_consts.py
|
|
38
38
|
src/csu/test_env.py
|
|
39
|
-
src/csu/test_exceptions.py
|
|
40
39
|
src/csu/test_management.py
|
|
41
40
|
src/csu/test_service.py
|
|
42
41
|
src/csu/test_timezones.py
|
|
@@ -83,6 +82,7 @@ src/csu/worker/registry.py
|
|
|
83
82
|
tests/conftest.py
|
|
84
83
|
tests/exampleworker.py
|
|
85
84
|
tests/test_exampleworker.py
|
|
85
|
+
tests/test_exceptions.py
|
|
86
86
|
tests/test_logging.py
|
|
87
87
|
tests/test_models.py
|
|
88
88
|
tests/test_service.py
|
|
@@ -3,12 +3,13 @@ from datetime import datetime
|
|
|
3
3
|
from zoneinfo import ZoneInfo
|
|
4
4
|
|
|
5
5
|
import time_machine
|
|
6
|
+
from inline_snapshot import snapshot
|
|
6
7
|
|
|
7
|
-
from
|
|
8
|
-
from .exceptions import APIServiceError
|
|
9
|
-
from .exceptions import ExhaustedRetriesError
|
|
10
|
-
from .exceptions import OpenServiceError
|
|
11
|
-
from .exceptions import get_event_id
|
|
8
|
+
from csu import exceptions
|
|
9
|
+
from csu.exceptions import APIServiceError
|
|
10
|
+
from csu.exceptions import ExhaustedRetriesError
|
|
11
|
+
from csu.exceptions import OpenServiceError
|
|
12
|
+
from csu.exceptions import get_event_id
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class OpenFooError(OpenServiceError):
|
|
@@ -25,11 +26,13 @@ def test_open_service_error(monkeypatch):
|
|
|
25
26
|
monkeypatch.setattr(exceptions, "get_event_id", lambda: 234)
|
|
26
27
|
api_exc = exc.as_api_service_error()
|
|
27
28
|
assert isinstance(api_exc, APIServiceError)
|
|
28
|
-
assert api_exc.detail ==
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
assert api_exc.detail == snapshot(
|
|
30
|
+
{
|
|
31
|
+
"accident_id": 234,
|
|
32
|
+
"code": "unknown",
|
|
33
|
+
"detail": "Unknown error",
|
|
34
|
+
}
|
|
35
|
+
)
|
|
33
36
|
|
|
34
37
|
|
|
35
38
|
def test_open_service_error_subclass(monkeypatch):
|
|
@@ -38,18 +41,22 @@ def test_open_service_error_subclass(monkeypatch):
|
|
|
38
41
|
monkeypatch.setattr(exceptions, "get_event_id", lambda: 123)
|
|
39
42
|
api_exc = exc.as_api_service_error()
|
|
40
43
|
assert isinstance(api_exc, APIServiceError)
|
|
41
|
-
assert api_exc.detail ==
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
assert api_exc.detail == snapshot(
|
|
45
|
+
{
|
|
46
|
+
"accident_id": 123,
|
|
47
|
+
"code": "unknown",
|
|
48
|
+
"detail": "proper foo",
|
|
49
|
+
}
|
|
50
|
+
)
|
|
46
51
|
|
|
47
52
|
|
|
48
53
|
def test_add_note():
|
|
49
54
|
exc = OpenServiceError("My message!", details=[1, 2, Exception(123)], event_id=None)
|
|
50
|
-
assert exc.__notes__ ==
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
assert exc.__notes__ == snapshot(
|
|
56
|
+
[
|
|
57
|
+
"(1, 2, Exception(123))",
|
|
58
|
+
]
|
|
59
|
+
)
|
|
53
60
|
|
|
54
61
|
exc = OpenServiceError("My message!", details=[], event_id=None)
|
|
55
62
|
assert getattr(exc, "__notes__", []) == []
|
|
@@ -84,4 +91,10 @@ def test_exhausted_retries_error():
|
|
|
84
91
|
def test_get_event_id(monkeypatch):
|
|
85
92
|
monkeypatch.setattr(exceptions, "urandom", lambda _: b"ZZZ")
|
|
86
93
|
with time_machine.travel(datetime(2024, 12, 12, 1, 2, 3, microsecond=456789, tzinfo=ZoneInfo("Europe/Bucharest"))):
|
|
87
|
-
assert get_event_id() == "241212:
|
|
94
|
+
assert get_event_id() == snapshot("241212:Wlpa:010203")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def test_get_accident_id(monkeypatch):
|
|
98
|
+
monkeypatch.setattr(exceptions, "urandom", lambda len: bytes(range(len)))
|
|
99
|
+
with time_machine.travel(1674777700.5816755):
|
|
100
|
+
assert get_event_id() == snapshot("230127:AAEC:020140")
|
|
@@ -104,7 +104,7 @@ def test_error_long(fake_accident_id, caplogs, httpbin):
|
|
|
104
104
|
assert exc.value.message == "It's ok."
|
|
105
105
|
api_exc = exc.value.as_api_service_error()
|
|
106
106
|
assert api_exc.status_code == 200
|
|
107
|
-
assert api_exc.detail == {"accident_id": "241212:
|
|
107
|
+
assert api_exc.detail == {"accident_id": "241212:AQ:000000", "code": "ok", "detail": "It's ok."}
|
|
108
108
|
|
|
109
109
|
assert len(fake_accident_id.calls) == 1
|
|
110
110
|
assert fake_accident_id.calls[0].startswith("service.py:")
|
|
@@ -116,7 +116,7 @@ def test_error_long(fake_accident_id, caplogs, httpbin):
|
|
|
116
116
|
) == snapshot(
|
|
117
117
|
[
|
|
118
118
|
"INFO | [&PID] Setting up BingoService with BASE_URL='[&HTTPBIN]' TIMEOUT=60 RETRIES=3 VERIFY=True",
|
|
119
|
-
'WARNING | [
|
|
119
|
+
'WARNING | [AQ:000000] __exit__ !> OkError("It\'s ok.", 1, event_id=241212:AQ:000000)',
|
|
120
120
|
"""\
|
|
121
121
|
WARNING | (renderer: NoneType)
|
|
122
122
|
----------------------------------------------------------------- context ------------------------------------------------------------------
|
|
@@ -138,9 +138,9 @@ test_service.OkError: OkError("It's ok.")
|
|
|
138
138
|
|
|
139
139
|
The above exception was the direct cause of the following exception:
|
|
140
140
|
|
|
141
|
-
csu.exceptions.APIServiceError: {'accident_id': '241212:
|
|
141
|
+
csu.exceptions.APIServiceError: {'accident_id': '241212:AQ:000000', 'detail': "It's ok.", 'code': 'ok'}
|
|
142
142
|
------------------------------------------------------------ response exception ------------------------------------------------------------
|
|
143
|
-
{'accident_id': '241212:
|
|
143
|
+
{'accident_id': '241212:AQ:000000', 'detail': "It's ok.", 'code': 'ok'}
|
|
144
144
|
============================================================================================================================================\
|
|
145
145
|
""",
|
|
146
146
|
]
|
|
@@ -155,7 +155,7 @@ def test_error(fake_accident_id, caplogs, httpbin):
|
|
|
155
155
|
assert exc.value.message == "It's ok."
|
|
156
156
|
api_exc = exc.value.as_api_service_error()
|
|
157
157
|
assert api_exc.status_code == 200
|
|
158
|
-
assert api_exc.detail == {"accident_id": "241212:
|
|
158
|
+
assert api_exc.detail == {"accident_id": "241212:AQ:000000", "code": "ok", "detail": "It's ok."}
|
|
159
159
|
|
|
160
160
|
assert len(fake_accident_id.calls) == 1
|
|
161
161
|
assert fake_accident_id.calls[0].startswith("service.py:")
|
|
@@ -168,7 +168,7 @@ def test_error(fake_accident_id, caplogs, httpbin):
|
|
|
168
168
|
[
|
|
169
169
|
"INFO | [&PID] Setting up BingoService with BASE_URL='[&HTTPBIN]' TIMEOUT=60 RETRIES=3 VERIFY=True",
|
|
170
170
|
"""\
|
|
171
|
-
INFO | [
|
|
171
|
+
INFO | [AQ:000000] GET [&HTTPBIN]/status/599
|
|
172
172
|
------------------------------------------------------------- request headers --------------------------------------------------------------
|
|
173
173
|
Accept: '*/*'
|
|
174
174
|
Accept-Encoding: 'gzip, deflate, br'
|
|
@@ -176,7 +176,7 @@ INFO | [01:000000.00] GET [&HTTPBIN]/status/599
|
|
|
176
176
|
User-Agent: 'niquests/3.18.6'\
|
|
177
177
|
""",
|
|
178
178
|
"""\
|
|
179
|
-
INFO | [
|
|
179
|
+
INFO | [AQ:000000] GET [&HTTPBIN]/status/599 => 599 in 0.0000s (HNone)
|
|
180
180
|
------------------------------------------------------------- response headers -------------------------------------------------------------
|
|
181
181
|
Access-Control-Allow-Credentials: 'true'
|
|
182
182
|
Access-Control-Allow-Origin: '*'
|
|
@@ -189,8 +189,8 @@ INFO | [01:000000.00] GET [&HTTPBIN]/status/599 => 599 in 0.0000s (HNone)
|
|
|
189
189
|
b''
|
|
190
190
|
============================================================================================================================================\
|
|
191
191
|
""",
|
|
192
|
-
"WARNING | [
|
|
193
|
-
"WARNING | [
|
|
192
|
+
"WARNING | [AQ:000000] GET [&HTTPBIN]/status/599 !> failed: UnexpectedStatusError('599 not in [200]', 599, b'', event_id=241212:AQ:000000)",
|
|
193
|
+
"WARNING | [AQ:000000] __exit__ !> OkError(\"It's ok.\", UnexpectedStatusError('599 not in [200]', 599, b'', event_id=241212:AQ:000000), event_id=241212:AQ:000000)",
|
|
194
194
|
]
|
|
195
195
|
)
|
|
196
196
|
|
|
@@ -215,7 +215,7 @@ def test_decoding(fake_accident_id, caplogs, httpbin):
|
|
|
215
215
|
[
|
|
216
216
|
"INFO | [&PID] Setting up BingoService with BASE_URL='[&HTTPBIN]' TIMEOUT=60 RETRIES=3 VERIFY=True",
|
|
217
217
|
"""\
|
|
218
|
-
INFO | [
|
|
218
|
+
INFO | [AQ:000000] GET [&HTTPBIN]/status/418
|
|
219
219
|
------------------------------------------------------------- request headers --------------------------------------------------------------
|
|
220
220
|
Accept: '*/*'
|
|
221
221
|
Accept-Encoding: 'gzip, deflate, br'
|
|
@@ -223,7 +223,7 @@ INFO | [01:000000.00] GET [&HTTPBIN]/status/418
|
|
|
223
223
|
User-Agent: 'niquests/3.18.6'\
|
|
224
224
|
""",
|
|
225
225
|
'''\
|
|
226
|
-
INFO | [
|
|
226
|
+
INFO | [AQ:000000] GET [&HTTPBIN]/status/418 => 418 in 0.0000s (HNone)
|
|
227
227
|
------------------------------------------------------------- response headers -------------------------------------------------------------
|
|
228
228
|
Access-Control-Allow-Credentials: 'true'
|
|
229
229
|
Access-Control-Allow-Origin: '*'
|
|
@@ -236,8 +236,8 @@ INFO | [01:000000.00] GET [&HTTPBIN]/status/418 => 418 in 0.0000s (HNone)
|
|
|
236
236
|
b'\\n -=[ teapot ]=-\\n\\n _...._\\n .\\' _ _ `.\\n | ."` ^ `". _,\\n \\\\_;`"---"`|//\\n | ;/\\n \\\\_ _/\\n `"""`\\n'
|
|
237
237
|
============================================================================================================================================\
|
|
238
238
|
''',
|
|
239
|
-
'WARNING | [
|
|
240
|
-
'WARNING | [
|
|
239
|
+
'WARNING | [AQ:000000] GET [&HTTPBIN]/status/418 !> failed: DecodeError(JSONDecodeError(\'Expecting value: line 2 column 5 (char 5)\'), 418, b\'\\n -=[ teapot ]=-\\n\\n _...._\\n .\\\' _ _ `.\\n | ."` ^ `". _,\\n \\\\_;`"---"`|//\\n | ;/\\n \\\\_ _/\\n `"""`\\n\', event_id=241212:AQ:000000)',
|
|
240
|
+
'WARNING | [AQ:000000] __exit__ !> DecodeError(JSONDecodeError(\'Expecting value: line 2 column 5 (char 5)\'), 418, b\'\\n -=[ teapot ]=-\\n\\n _...._\\n .\\\' _ _ `.\\n | ."` ^ `". _,\\n \\\\_;`"---"`|//\\n | ;/\\n \\\\_ _/\\n `"""`\\n\', event_id=241212:AQ:000000)',
|
|
241
241
|
'''\
|
|
242
242
|
ERROR | (renderer: NoneType)
|
|
243
243
|
----------------------------------------------------------------- context ------------------------------------------------------------------
|
|
@@ -283,7 +283,7 @@ Traceback (most recent call last):
|
|
|
283
283
|
csu.exceptions.DecodeError: DecodeError(JSONDecodeError('Expecting value: line 2 column 5 (char 5)'), response=<Response Dummy [418]>)
|
|
284
284
|
(418, b'\\n -=[ teapot ]=-\\n\\n _...._\\n .\\' _ _ `.\\n | ."` ^ `". _,\\n \\\\_;`"---"`|//\\n | ;/\\n \\\\_ _/\\n `"""`\\n')
|
|
285
285
|
------------------------------------------------------------ response exception ------------------------------------------------------------
|
|
286
|
-
{'accident_id': '241212:
|
|
286
|
+
{'accident_id': '241212:AQ:000000', 'detail': 'Internal server error.', 'code': 'server'}
|
|
287
287
|
============================================================================================================================================\
|
|
288
288
|
''',
|
|
289
289
|
]
|
|
@@ -308,7 +308,7 @@ def test_logging(fake_accident_id, caplogs, httpbin):
|
|
|
308
308
|
[
|
|
309
309
|
"INFO | [&PID] Setting up BingoService with BASE_URL='[&HTTPBIN]' TIMEOUT=60 RETRIES=3 VERIFY=True",
|
|
310
310
|
"""\
|
|
311
|
-
INFO | [
|
|
311
|
+
INFO | [AQ:000000] GET [&HTTPBIN]/status/599
|
|
312
312
|
------------------------------------------------------------- request headers --------------------------------------------------------------
|
|
313
313
|
Accept: '*/*'
|
|
314
314
|
Accept-Encoding: 'gzip, deflate, br'
|
|
@@ -316,7 +316,7 @@ INFO | [01:000000.00] GET [&HTTPBIN]/status/599
|
|
|
316
316
|
User-Agent: 'niquests/3.18.6'\
|
|
317
317
|
""",
|
|
318
318
|
"""\
|
|
319
|
-
INFO | [
|
|
319
|
+
INFO | [AQ:000000] GET [&HTTPBIN]/status/599 => 599 in 0.0000s (HNone)
|
|
320
320
|
------------------------------------------------------------- response headers -------------------------------------------------------------
|
|
321
321
|
Access-Control-Allow-Credentials: 'true'
|
|
322
322
|
Access-Control-Allow-Origin: '*'
|
|
@@ -329,8 +329,8 @@ INFO | [01:000000.00] GET [&HTTPBIN]/status/599 => 599 in 0.0000s (HNone)
|
|
|
329
329
|
b''
|
|
330
330
|
============================================================================================================================================\
|
|
331
331
|
""",
|
|
332
|
-
"WARNING | [
|
|
333
|
-
"WARNING | [
|
|
332
|
+
"WARNING | [AQ:000000] GET [&HTTPBIN]/status/599 !> failed: UnexpectedStatusError('599 not in [200]', 599, b'', event_id=241212:AQ:000000)",
|
|
333
|
+
"WARNING | [AQ:000000] __exit__ !> OkError(\"It's ok.\", UnexpectedStatusError('599 not in [200]', 599, b'', event_id=241212:AQ:000000), event_id=241212:AQ:000000)",
|
|
334
334
|
"""\
|
|
335
335
|
WARNING | (renderer: NoneType)
|
|
336
336
|
----------------------------------------------------------------- context ------------------------------------------------------------------
|
|
@@ -354,13 +354,13 @@ Traceback (most recent call last):
|
|
|
354
354
|
File "[&TEST_PATH]", line 50, in error
|
|
355
355
|
raise OkError(details=[exc], event_id=ctx.event_id) from exc
|
|
356
356
|
test_service.OkError: OkError("It's ok.")
|
|
357
|
-
(UnexpectedStatusError('599 not in [200]', 599, b'', event_id=241212:
|
|
357
|
+
(UnexpectedStatusError('599 not in [200]', 599, b'', event_id=241212:AQ:000000),)
|
|
358
358
|
|
|
359
359
|
The above exception was the direct cause of the following exception:
|
|
360
360
|
|
|
361
|
-
csu.exceptions.APIServiceError: {'accident_id': '241212:
|
|
361
|
+
csu.exceptions.APIServiceError: {'accident_id': '241212:AQ:000000', 'detail': "It's ok.", 'code': 'ok'}
|
|
362
362
|
------------------------------------------------------------ response exception ------------------------------------------------------------
|
|
363
|
-
{'accident_id': '241212:
|
|
363
|
+
{'accident_id': '241212:AQ:000000', 'detail': "It's ok.", 'code': 'ok'}
|
|
364
364
|
============================================================================================================================================\
|
|
365
365
|
""",
|
|
366
366
|
]
|
|
@@ -512,7 +512,7 @@ def test_custom_context(httpbin, fake_accident_id, caplogs):
|
|
|
512
512
|
[
|
|
513
513
|
"INFO | [&PID] Setting up CustomService with BASE_URL='[&HTTPBIN]' TIMEOUT=60 RETRIES=3 VERIFY=True",
|
|
514
514
|
"""\
|
|
515
|
-
INFO | [
|
|
515
|
+
INFO | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=3&retry_count=0&retry_statuses=%7B200%7D
|
|
516
516
|
------------------------------------------------------------- request headers --------------------------------------------------------------
|
|
517
517
|
Accept: '*/*'
|
|
518
518
|
Accept-Encoding: 'gzip, deflate, br'
|
|
@@ -524,7 +524,7 @@ INFO | [01:000000.00] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999
|
|
|
524
524
|
============================================================================================================================================\
|
|
525
525
|
""",
|
|
526
526
|
"""\
|
|
527
|
-
INFO | [
|
|
527
|
+
INFO | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=3&retry_count=0&retry_statuses=%7B200%7D => 200 in 0.0000s (HNone)
|
|
528
528
|
------------------------------------------------------------- response headers -------------------------------------------------------------
|
|
529
529
|
Access-Control-Allow-Credentials: 'true'
|
|
530
530
|
Access-Control-Allow-Origin: '*'
|
|
@@ -538,7 +538,7 @@ INFO | [01:000000.00] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999
|
|
|
538
538
|
============================================================================================================================================\
|
|
539
539
|
""",
|
|
540
540
|
"""\
|
|
541
|
-
ERROR | [
|
|
541
|
+
ERROR | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=3&retry_count=0&retry_statuses=%7B200%7D !> RetryableStatusError('200 not in [999] but in [200]', 200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"3","retry_count":"0","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=3&retry_count=0&retry_statuses={200}"}\\n', event_id=241212:AQ:000000) (will retry 3 more times)
|
|
542
542
|
Traceback (most recent call last):
|
|
543
543
|
File "[&SERVICE_PATH]", line 312, in request
|
|
544
544
|
raise RetryableStatusError(response, accept_statuses, retry_statuses, event_id=self.event_id)
|
|
@@ -546,7 +546,7 @@ csu.exceptions.RetryableStatusError: RetryableStatusError(<Response Dummy [200]>
|
|
|
546
546
|
(200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"3","retry_count":"0","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=3&retry_count=0&retry_statuses={200}"}\\n')
|
|
547
547
|
""",
|
|
548
548
|
"""\
|
|
549
|
-
INFO | [
|
|
549
|
+
INFO | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=2&retry_count=1&retry_statuses=%7B200%7D
|
|
550
550
|
------------------------------------------------------------- request headers --------------------------------------------------------------
|
|
551
551
|
Accept: '*/*'
|
|
552
552
|
Accept-Encoding: 'gzip, deflate, br'
|
|
@@ -558,7 +558,7 @@ INFO | [01:000000.00] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999
|
|
|
558
558
|
============================================================================================================================================\
|
|
559
559
|
""",
|
|
560
560
|
"""\
|
|
561
|
-
INFO | [
|
|
561
|
+
INFO | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=2&retry_count=1&retry_statuses=%7B200%7D => 200 in 0.0000s (HNone)
|
|
562
562
|
------------------------------------------------------------- response headers -------------------------------------------------------------
|
|
563
563
|
Access-Control-Allow-Credentials: 'true'
|
|
564
564
|
Access-Control-Allow-Origin: '*'
|
|
@@ -572,7 +572,7 @@ INFO | [01:000000.00] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999
|
|
|
572
572
|
============================================================================================================================================\
|
|
573
573
|
""",
|
|
574
574
|
"""\
|
|
575
|
-
ERROR | [
|
|
575
|
+
ERROR | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=2&retry_count=1&retry_statuses=%7B200%7D !> RetryableStatusError('200 not in [999] but in [200]', 200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"2","retry_count":"1","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=2&retry_count=1&retry_statuses={200}"}\\n', event_id=241212:AQ:000000) (will retry 2 more times)
|
|
576
576
|
Traceback (most recent call last):
|
|
577
577
|
File "[&SERVICE_PATH]", line 312, in request
|
|
578
578
|
raise RetryableStatusError(response, accept_statuses, retry_statuses, event_id=self.event_id)
|
|
@@ -580,7 +580,7 @@ csu.exceptions.RetryableStatusError: RetryableStatusError(<Response Dummy [200]>
|
|
|
580
580
|
(200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"2","retry_count":"1","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=2&retry_count=1&retry_statuses={200}"}\\n')
|
|
581
581
|
""",
|
|
582
582
|
"""\
|
|
583
|
-
INFO | [
|
|
583
|
+
INFO | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=1&retry_count=2&retry_statuses=%7B200%7D
|
|
584
584
|
------------------------------------------------------------- request headers --------------------------------------------------------------
|
|
585
585
|
Accept: '*/*'
|
|
586
586
|
Accept-Encoding: 'gzip, deflate, br'
|
|
@@ -592,7 +592,7 @@ INFO | [01:000000.00] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999
|
|
|
592
592
|
============================================================================================================================================\
|
|
593
593
|
""",
|
|
594
594
|
"""\
|
|
595
|
-
INFO | [
|
|
595
|
+
INFO | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=1&retry_count=2&retry_statuses=%7B200%7D => 200 in 0.0000s (HNone)
|
|
596
596
|
------------------------------------------------------------- response headers -------------------------------------------------------------
|
|
597
597
|
Access-Control-Allow-Credentials: 'true'
|
|
598
598
|
Access-Control-Allow-Origin: '*'
|
|
@@ -606,7 +606,7 @@ INFO | [01:000000.00] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999
|
|
|
606
606
|
============================================================================================================================================\
|
|
607
607
|
""",
|
|
608
608
|
"""\
|
|
609
|
-
ERROR | [
|
|
609
|
+
ERROR | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=1&retry_count=2&retry_statuses=%7B200%7D !> RetryableStatusError('200 not in [999] but in [200]', 200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"1","retry_count":"2","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=1&retry_count=2&retry_statuses={200}"}\\n', event_id=241212:AQ:000000) (will retry 1 more times)
|
|
610
610
|
Traceback (most recent call last):
|
|
611
611
|
File "[&SERVICE_PATH]", line 312, in request
|
|
612
612
|
raise RetryableStatusError(response, accept_statuses, retry_statuses, event_id=self.event_id)
|
|
@@ -614,7 +614,7 @@ csu.exceptions.RetryableStatusError: RetryableStatusError(<Response Dummy [200]>
|
|
|
614
614
|
(200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"1","retry_count":"2","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=1&retry_count=2&retry_statuses={200}"}\\n')
|
|
615
615
|
""",
|
|
616
616
|
"""\
|
|
617
|
-
INFO | [
|
|
617
|
+
INFO | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=0&retry_count=3&retry_statuses=%7B200%7D
|
|
618
618
|
------------------------------------------------------------- request headers --------------------------------------------------------------
|
|
619
619
|
Accept: '*/*'
|
|
620
620
|
Accept-Encoding: 'gzip, deflate, br'
|
|
@@ -626,7 +626,7 @@ INFO | [01:000000.00] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999
|
|
|
626
626
|
============================================================================================================================================\
|
|
627
627
|
""",
|
|
628
628
|
"""\
|
|
629
|
-
INFO | [
|
|
629
|
+
INFO | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=0&retry_count=3&retry_statuses=%7B200%7D => 200 in 0.0000s (HNone)
|
|
630
630
|
------------------------------------------------------------- response headers -------------------------------------------------------------
|
|
631
631
|
Access-Control-Allow-Credentials: 'true'
|
|
632
632
|
Access-Control-Allow-Origin: '*'
|
|
@@ -639,8 +639,8 @@ INFO | [01:000000.00] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999
|
|
|
639
639
|
b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"0","retry_count":"3","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=0&retry_count=3&retry_statuses={200}"}\\n'
|
|
640
640
|
============================================================================================================================================\
|
|
641
641
|
""",
|
|
642
|
-
'ERROR | [
|
|
643
|
-
'WARNING | [
|
|
642
|
+
'ERROR | [AQ:000000] POST [&HTTPBIN]/anything?foo=bar&accept_statuses=%7B999%7D&expect_json=true&follow_redirects=false&retries_left=0&retry_count=3&retry_statuses=%7B200%7D !> RetryableStatusError(\'200 not in [999] but in [200]\', 200, b\'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"0","retry_count":"3","retry_statuses":"{200}"},"data":"config={\\\'custom\\\': \\\'config\\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=0&retry_count=3&retry_statuses={200}"}\\n\', event_id=241212:AQ:000000) (exhausted retries)',
|
|
643
|
+
'WARNING | [AQ:000000] __exit__ !> ExhaustedRetriesError(3, [RetryableStatusError(\'200 not in [999] but in [200]\', 200, b\'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"3","retry_count":"0","retry_statuses":"{200}"},"data":"config={\\\'custom\\\': \\\'config\\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=3&retry_count=0&retry_statuses={200}"}\\n\', event_id=241212:AQ:000000), RetryableStatusError(\'200 not in [999] but in [200]\', 200, b\'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"2","retry_count":"1","retry_statuses":"{200}"},"data":"config={\\\'custom\\\': \\\'config\\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=2&retry_count=1&retry_statuses={200}"}\\n\', event_id=241212:AQ:000000), RetryableStatusError(\'200 not in [999] but in [200]\', 200, b\'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"1","retry_count":"2","retry_statuses":"{200}"},"data":"config={\\\'custom\\\': \\\'config\\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=1&retry_count=2&retry_statuses={200}"}\\n\', event_id=241212:AQ:000000), RetryableStatusError(\'200 not in [999] but in [200]\', 200, b\'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"0","retry_count":"3","retry_statuses":"{200}"},"data":"config={\\\'custom\\\': \\\'config\\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=0&retry_count=3&retry_statuses={200}"}\\n\', event_id=241212:AQ:000000)], event_id=241212:AQ:000000)',
|
|
644
644
|
"""\
|
|
645
645
|
ERROR | (renderer: NoneType)
|
|
646
646
|
----------------------------------------------------------------- context ------------------------------------------------------------------
|
|
@@ -659,7 +659,7 @@ ERROR | (renderer: NoneType)
|
|
|
659
659
|
| File "[&SERVICE_PATH]", line 326, in request
|
|
660
660
|
| raise ExhaustedRetriesError(retry_budget, retry_failures, event_id=self.event_id)
|
|
661
661
|
| csu.exceptions.ExhaustedRetriesError: ExhaustedRetriesError(3)
|
|
662
|
-
| ([RetryableStatusError('200 not in [999] but in [200]', 200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"3","retry_count":"0","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=3&retry_count=0&retry_statuses={200}"}\\n', event_id=241212:
|
|
662
|
+
| ([RetryableStatusError('200 not in [999] but in [200]', 200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"3","retry_count":"0","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=3&retry_count=0&retry_statuses={200}"}\\n', event_id=241212:AQ:000000), RetryableStatusError('200 not in [999] but in [200]', 200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"2","retry_count":"1","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=2&retry_count=1&retry_statuses={200}"}\\n', event_id=241212:AQ:000000), RetryableStatusError('200 not in [999] but in [200]', 200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"1","retry_count":"2","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=1&retry_count=2&retry_statuses={200}"}\\n', event_id=241212:AQ:000000), RetryableStatusError('200 not in [999] but in [200]', 200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"0","retry_count":"3","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=0&retry_count=3&retry_statuses={200}"}\\n', event_id=241212:AQ:000000)],)
|
|
663
663
|
+-+---------------- 1 ----------------
|
|
664
664
|
| Traceback (most recent call last):
|
|
665
665
|
| File "[&SERVICE_PATH]", line 312, in request
|
|
@@ -686,7 +686,7 @@ ERROR | (renderer: NoneType)
|
|
|
686
686
|
| (200, b'{"args":{"accept_statuses":"{999}","expect_json":"true","follow_redirects":"false","foo":"bar","retries_left":"0","retry_count":"3","retry_statuses":"{200}"},"data":"config={\\'custom\\': \\'config\\'}","files":{},"form":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Content-Length":"27","Host":"127.0.0.1:12345","User-Agent":"python-httpx/0.X.X"},"json":null,"method":"POST","origin":"127.0.0.1","url":"http://127.0.0.1:12345/anything?foo=bar&accept_statuses={999}&expect_json=true&follow_redirects=false&retries_left=0&retry_count=3&retry_statuses={200}"}\\n')
|
|
687
687
|
+------------------------------------
|
|
688
688
|
------------------------------------------------------------ response exception ------------------------------------------------------------
|
|
689
|
-
{'accident_id': '241212:
|
|
689
|
+
{'accident_id': '241212:AQ:000000', 'detail': 'Internal server error.', 'code': 'server'}
|
|
690
690
|
============================================================================================================================================\
|
|
691
691
|
""",
|
|
692
692
|
]
|