csu 2.6.7__tar.gz → 2.6.9__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.7 → csu-2.6.9}/.bumpversion.cfg +1 -1
- {csu-2.6.7 → csu-2.6.9}/.cookiecutterrc +1 -1
- {csu-2.6.7 → csu-2.6.9}/PKG-INFO +3 -3
- {csu-2.6.7 → csu-2.6.9}/README.rst +2 -2
- {csu-2.6.7 → csu-2.6.9}/pyproject.toml +1 -1
- {csu-2.6.7 → csu-2.6.9}/src/csu/__init__.py +1 -1
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/serializers.py +0 -10
- {csu-2.6.7 → csu-2.6.9}/src/csu/logging.py +7 -6
- {csu-2.6.7 → csu-2.6.9}/src/csu.egg-info/PKG-INFO +3 -3
- csu-2.6.9/tests/test_logging.py +110 -0
- csu-2.6.7/tests/test_logging.py +0 -32
- {csu-2.6.7 → csu-2.6.9}/.coveragerc +0 -0
- {csu-2.6.7 → csu-2.6.9}/.editorconfig +0 -0
- {csu-2.6.7 → csu-2.6.9}/.github/workflows/github-actions.yml +0 -0
- {csu-2.6.7 → csu-2.6.9}/.pre-commit-config.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/.tombi.toml +0 -0
- {csu-2.6.7 → csu-2.6.9}/AUTHORS.rst +0 -0
- {csu-2.6.7 → csu-2.6.9}/CHANGELOG.rst +0 -0
- {csu-2.6.7 → csu-2.6.9}/CONTRIBUTING.rst +0 -0
- {csu-2.6.7 → csu-2.6.9}/LICENSE +0 -0
- {csu-2.6.7 → csu-2.6.9}/MANIFEST.in +0 -0
- {csu-2.6.7 → csu-2.6.9}/ci/bootstrap.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/ci/requirements.txt +0 -0
- {csu-2.6.7 → csu-2.6.9}/ci/templates/.github/workflows/github-actions.yml +0 -0
- {csu-2.6.7 → csu-2.6.9}/pytest.ini +0 -0
- {csu-2.6.7 → csu-2.6.9}/setup.cfg +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/admin.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/conf.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/consts.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/__init__.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/auth.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/fields.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/forms.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/perms.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/phonenumber.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/test_auth.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/test_fields.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/test_forms.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/test_phonenumber.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/test_serializers.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/drf/views.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/enums.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/env.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/exceptions.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/export.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/fixups.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/forms/__init__.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/forms/crispy.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/forms/fields.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/gettext.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/gettext_lazy.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/locale/ro/LC_MESSAGES/django.mo +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/locale/ro/LC_MESSAGES/django.po +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/management.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/models.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/query.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/routers.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/service.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/templates/api_exception.html +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/templates/forms/widgets/opaquewidget.html +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/test_consts.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/test_env.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/test_management.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/test_service.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/test_timezones.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/test_utils.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/test_xml.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/timezones.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/utils.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/views.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/worker/__init__.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/worker/admin.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/worker/asgi.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/worker/engine.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/worker/enums.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/worker/job.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/worker/models.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/worker/registry.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/wsgi.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu/xml.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu.egg-info/SOURCES.txt +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu.egg-info/dependency_links.txt +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu.egg-info/requires.txt +0 -0
- {csu-2.6.7 → csu-2.6.9}/src/csu.egg-info/top_level.txt +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service/test_custom_context.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service/test_custom_context_0_retries.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service/test_decoding.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service/test_error.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service/test_logging.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service/test_redirects.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service_auth/test_async.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service_auth/test_async_auth.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service_auth/test_sync.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/cassettes/test_service_auth/test_sync_auth.yaml +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/conftest.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/exampleworker.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/test_exampleworker.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/test_exceptions.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/test_models.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/test_service.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/test_service_auth.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/test_views.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/test_worker.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/testproject/__init__.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/testproject/fixtures/testuser.json +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/testproject/models.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/testproject/settings.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tests/testproject/urls.py +0 -0
- {csu-2.6.7 → csu-2.6.9}/tox.ini +0 -0
{csu-2.6.7 → csu-2.6.9}/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.9
|
|
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.9.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.9...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.9.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.9...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/
|
|
@@ -74,11 +74,6 @@ class ConfirmSerializer(Serializer):
|
|
|
74
74
|
|
|
75
75
|
confirm = BooleanField(required=True, initial=False, allow_null=True)
|
|
76
76
|
|
|
77
|
-
def __init__(self, *args, **kwargs):
|
|
78
|
-
if kwargs.get("partial"):
|
|
79
|
-
raise TypeError("Cannot accept a true value for 'partial'")
|
|
80
|
-
super().__init__(*args, **kwargs)
|
|
81
|
-
|
|
82
77
|
def create(self, validated_data):
|
|
83
78
|
raise TypeError("This serializer can only confirm!")
|
|
84
79
|
|
|
@@ -106,11 +101,6 @@ class CancelSerializer(Serializer):
|
|
|
106
101
|
cancel_error = _("Cannot cancel.")
|
|
107
102
|
cancel = BooleanField(required=True, initial=False, allow_null=True)
|
|
108
103
|
|
|
109
|
-
def __init__(self, *args, **kwargs):
|
|
110
|
-
if kwargs.get("partial"):
|
|
111
|
-
raise TypeError("Cannot accept a true value for 'partial'")
|
|
112
|
-
super().__init__(*args, **kwargs)
|
|
113
|
-
|
|
114
104
|
def create(self, validated_data):
|
|
115
105
|
raise TypeError("This serializer can only cancel!")
|
|
116
106
|
|
|
@@ -45,7 +45,7 @@ def get_remote_addresses(environ, placeholder=None):
|
|
|
45
45
|
def get_request_line(environ, status_code, auth=None, *extra_auth):
|
|
46
46
|
auth_info = []
|
|
47
47
|
if auth:
|
|
48
|
-
auth_info.append(auth)
|
|
48
|
+
auth_info.append(trim_auth_info(auth))
|
|
49
49
|
else:
|
|
50
50
|
auth = environ.get("HTTP_AUTHORIZATION", "")
|
|
51
51
|
if isinstance(auth, bytes):
|
|
@@ -57,25 +57,26 @@ def get_request_line(environ, status_code, auth=None, *extra_auth):
|
|
|
57
57
|
except Exception as exc:
|
|
58
58
|
auth_info.extend((auth, exc, details))
|
|
59
59
|
else:
|
|
60
|
-
auth_info.extend((auth, user))
|
|
60
|
+
auth_info.extend((auth, trim_auth_info(user)))
|
|
61
61
|
else:
|
|
62
|
-
auth_info.extend((auth, details))
|
|
62
|
+
auth_info.extend((auth, trim_auth_info(details)))
|
|
63
63
|
|
|
64
|
-
auth_info.extend(extra_auth)
|
|
64
|
+
auth_info.extend(map(trim_auth_info, extra_auth))
|
|
65
65
|
if query := environ.get("QUERY_STRING"):
|
|
66
66
|
query = f"?{query}"
|
|
67
67
|
else:
|
|
68
68
|
query = ""
|
|
69
69
|
format = f'"{environ["REQUEST_METHOD"]} {environ["PATH_INFO"]}%s" {status_code} +[%s] @%s'
|
|
70
70
|
remote_addr = " via ".join(get_remote_addresses(environ, placeholder="?"))
|
|
71
|
-
auth_info =
|
|
71
|
+
auth_info = ";".join(str(item) for item in auth_info if item)
|
|
72
72
|
arguments = [query, auth_info, remote_addr]
|
|
73
73
|
return format, arguments
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
def trim_auth_info(auth_info, limit: int | None = LOGGING_AUTH_INFO_LIMIT):
|
|
77
|
+
assert isinstance(auth_info, str), f"{auth_info=!r} is not str!"
|
|
77
78
|
if limit and (auth_size := len(auth_info)) > limit:
|
|
78
|
-
prefix_limit = limit *
|
|
79
|
+
prefix_limit = limit * 7 // 8
|
|
79
80
|
suffix_limit = limit - prefix_limit
|
|
80
81
|
return f"{auth_info[:prefix_limit]} ..({auth_size - limit} more).. {auth_info[-suffix_limit:]}"
|
|
81
82
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: csu
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.9
|
|
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.9.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.9...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/
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
from inline_snapshot import snapshot
|
|
2
|
+
|
|
3
|
+
from csu.logging import fa_append_repr
|
|
4
|
+
from csu.logging import get_request_line
|
|
5
|
+
from csu.logging import trim_auth_info
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_fa_append_repr():
|
|
9
|
+
a = []
|
|
10
|
+
b = []
|
|
11
|
+
assert fa_append_repr(a, b, "123456", 3) is None
|
|
12
|
+
assert a == snapshot(["%s\n ... %s more characters"])
|
|
13
|
+
assert b == snapshot(["'12", 5])
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def test_get_request_line():
|
|
17
|
+
assert [
|
|
18
|
+
fmt % tuple(args)
|
|
19
|
+
for fmt, args in [
|
|
20
|
+
get_request_line({"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123"}, 200),
|
|
21
|
+
get_request_line({"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123"}, 200, "abcdefg1234567890ABCDEFG"),
|
|
22
|
+
get_request_line({"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123"}, 200, "abcdefg1234567890ABCDEFG", "FOOBARFOOBARFOOBARFOOBARFOOBARv"),
|
|
23
|
+
get_request_line({"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Caca Macacacacacacacacacacacacaca"}, 200),
|
|
24
|
+
get_request_line({"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Beeeeeeeeearer 123123123123123123"}, 200),
|
|
25
|
+
get_request_line({"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Basic"}, 200),
|
|
26
|
+
get_request_line({"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Basic garbagegarbagegarbagegarbagegarbage"}, 200),
|
|
27
|
+
get_request_line(
|
|
28
|
+
{"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Caca Macacacacacacacacacacacacaca"},
|
|
29
|
+
200,
|
|
30
|
+
"abcdefg1234567890ABCDEFG",
|
|
31
|
+
),
|
|
32
|
+
get_request_line(
|
|
33
|
+
{"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Beeeeeeeeearer 123123123123123123"},
|
|
34
|
+
200,
|
|
35
|
+
"abcdefg1234567890ABCDEFG",
|
|
36
|
+
),
|
|
37
|
+
get_request_line({"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Basic"}, 200, "abcdefg1234567890ABCDEFG"),
|
|
38
|
+
get_request_line(
|
|
39
|
+
{"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Basic garbagegarbagegarbagegarbagegarbage"},
|
|
40
|
+
200,
|
|
41
|
+
"abcdefg1234567890ABCDEFG",
|
|
42
|
+
),
|
|
43
|
+
get_request_line(
|
|
44
|
+
{"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Caca Macacacacacacacacacacacacaca"},
|
|
45
|
+
200,
|
|
46
|
+
"abcdefg1234567890ABCDEFG",
|
|
47
|
+
"FOOBARFOOBARFOOBARFOOBARFOOBARv",
|
|
48
|
+
),
|
|
49
|
+
get_request_line(
|
|
50
|
+
{"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Beeeeeeeeearer 123123123123123123"},
|
|
51
|
+
200,
|
|
52
|
+
"abcdefg1234567890ABCDEFG",
|
|
53
|
+
"FOOBARFOOBARFOOBARFOOBARFOOBARv",
|
|
54
|
+
),
|
|
55
|
+
get_request_line(
|
|
56
|
+
{"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Basic"},
|
|
57
|
+
200,
|
|
58
|
+
"abcdefg1234567890ABCDEFG",
|
|
59
|
+
"FOOBARFOOBARFOOBARFOOBARFOOBARv",
|
|
60
|
+
),
|
|
61
|
+
get_request_line(
|
|
62
|
+
{"REQUEST_METHOD": "PUT", "PATH_INFO": "/foobar/123", "HTTP_AUTHORIZATION": "Basic garbagegarbagegarbagegarbagegarbage"},
|
|
63
|
+
200,
|
|
64
|
+
"abcdefg1234567890ABCDEFG",
|
|
65
|
+
"FOOBARFOOBARFOOBARFOOBARFOOBARv",
|
|
66
|
+
),
|
|
67
|
+
]
|
|
68
|
+
] == snapshot(
|
|
69
|
+
[
|
|
70
|
+
'"PUT /foobar/123" 200 +[] @?',
|
|
71
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG] @?',
|
|
72
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG;FOOBARFOOB ..(19 more).. Rv] @?',
|
|
73
|
+
'"PUT /foobar/123" 200 +[Caca;Macacacaca ..(16 more).. ca] @?',
|
|
74
|
+
'"PUT /foobar/123" 200 +[Beeeeeeeeearer;1231231231 ..(6 more).. 23] @?',
|
|
75
|
+
'"PUT /foobar/123" 200 +[Basic] @?',
|
|
76
|
+
'"PUT /foobar/123" 200 +[Basic;Incorrect padding;garbagegarbagegarbagegarbagegarbage] @?',
|
|
77
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG] @?',
|
|
78
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG] @?',
|
|
79
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG] @?',
|
|
80
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG] @?',
|
|
81
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG;FOOBARFOOB ..(19 more).. Rv] @?',
|
|
82
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG;FOOBARFOOB ..(19 more).. Rv] @?',
|
|
83
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG;FOOBARFOOB ..(19 more).. Rv] @?',
|
|
84
|
+
'"PUT /foobar/123" 200 +[abcdefg123 ..(12 more).. FG;FOOBARFOOB ..(19 more).. Rv] @?',
|
|
85
|
+
]
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def test_trim_auth_info():
|
|
90
|
+
assert [
|
|
91
|
+
trim_auth_info("12_123456_123456789-abcdefg", 12),
|
|
92
|
+
trim_auth_info("12_123456_123456789-abcdefg", 13),
|
|
93
|
+
trim_auth_info("12_123456_123456789-abcdefg", 14),
|
|
94
|
+
trim_auth_info("12_123456_123456789-abcdefg", 15),
|
|
95
|
+
trim_auth_info("12_123456_123456789-abcdefg", 16),
|
|
96
|
+
trim_auth_info("12_123456_123456789-abcdefg", 17),
|
|
97
|
+
trim_auth_info("Basic", 12),
|
|
98
|
+
trim_auth_info("Bearer", 12),
|
|
99
|
+
] == snapshot(
|
|
100
|
+
[
|
|
101
|
+
"12_123456_ ..(15 more).. fg",
|
|
102
|
+
"12_123456_1 ..(14 more).. fg",
|
|
103
|
+
"12_123456_12 ..(13 more).. fg",
|
|
104
|
+
"12_123456_123 ..(12 more).. fg",
|
|
105
|
+
"12_123456_1234 ..(11 more).. fg",
|
|
106
|
+
"12_123456_1234 ..(10 more).. efg",
|
|
107
|
+
"Basic",
|
|
108
|
+
"Bearer",
|
|
109
|
+
]
|
|
110
|
+
)
|
csu-2.6.7/tests/test_logging.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from inline_snapshot import snapshot
|
|
2
|
-
|
|
3
|
-
from csu.logging import fa_append_repr
|
|
4
|
-
from csu.logging import trim_auth_info
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def test_fa_append_repr():
|
|
8
|
-
a = []
|
|
9
|
-
b = []
|
|
10
|
-
assert fa_append_repr(a, b, "123456", 3) is None
|
|
11
|
-
assert a == snapshot(["%s\n ... %s more characters"])
|
|
12
|
-
assert b == snapshot(["'12", 5])
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def test_trim_auth_info():
|
|
16
|
-
assert [
|
|
17
|
-
trim_auth_info("12_123456_123456789-abcdefg", 12),
|
|
18
|
-
trim_auth_info("12_123456_123456789-abcdefg", 13),
|
|
19
|
-
trim_auth_info("12_123456_123456789-abcdefg", 14),
|
|
20
|
-
trim_auth_info("12_123456_123456789-abcdefg", 15),
|
|
21
|
-
trim_auth_info("12_123456_123456789-abcdefg", 16),
|
|
22
|
-
trim_auth_info("12_123456_123456789-abcdefg", 17),
|
|
23
|
-
] == snapshot(
|
|
24
|
-
[
|
|
25
|
-
"12_12345 ..(15 more).. defg",
|
|
26
|
-
"12_12345 ..(14 more).. cdefg",
|
|
27
|
-
"12_123456 ..(13 more).. cdefg",
|
|
28
|
-
"12_123456_ ..(12 more).. cdefg",
|
|
29
|
-
"12_123456_ ..(11 more).. bcdefg",
|
|
30
|
-
"12_123456_1 ..(10 more).. bcdefg",
|
|
31
|
-
]
|
|
32
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{csu-2.6.7 → csu-2.6.9}/LICENSE
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{csu-2.6.7 → csu-2.6.9}/tox.ini
RENAMED
|
File without changes
|