Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor (testing): preserve raw path in scope creation #2331

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b701f49
refactor (response): Remove deprecated attributes
aarcex3 Sep 1, 2024
e2f4e98
refactor (response): Organize imports with ruff check --fix
aarcex3 Sep 2, 2024
da19b96
test (response): Refactor test_response_set_stream test
aarcex3 Sep 2, 2024
3793c82
test (response): Fix set stream test
aarcex3 Sep 2, 2024
35aee4d
Merge branch 'master' into master
vytas7 Sep 2, 2024
754cf1f
test (response): Improve assertion
aarcex3 Sep 2, 2024
c5babad
Merge branch 'falconry:master' into master
aarcex3 Sep 12, 2024
c533f04
feat (status_codes): add new status codes
aarcex3 Sep 12, 2024
d85f616
style: run ruff format
aarcex3 Sep 12, 2024
1b9ede9
docs (status): update docs
aarcex3 Sep 13, 2024
246e132
style (status_codes): fix typo
aarcex3 Sep 13, 2024
d17737a
docs (status): fix typo
aarcex3 Sep 13, 2024
f799aa8
Merge branch 'master' into master
vytas7 Sep 15, 2024
b011810
Merge branch 'falconry:master' into master
aarcex3 Sep 16, 2024
9c5604d
refactor (helpers): add raw_uri to the asgi scope
aarcex3 Sep 17, 2024
9ed2f26
test (asgi): add test for create_scope
aarcex3 Sep 17, 2024
15bba29
refactor (helpers): update raw_path implementation
aarcex3 Sep 17, 2024
6527926
refactor (asgi): refactor test scope raw_path
aarcex3 Sep 17, 2024
86f63cf
refactor (helpers): remove queries from raw_path
aarcex3 Sep 17, 2024
cfe5b6f
Merge branch 'master' into master
aarcex3 Sep 20, 2024
f87ec9e
docs (_newsfragment): add docs about changes
aarcex3 Sep 20, 2024
42450de
Merge branch 'master' into master
aarcex3 Sep 20, 2024
3b6a837
Merge branch 'falconry:master' into master
aarcex3 Sep 23, 2024
0f75d62
Merge branch 'master' into master
aarcex3 Sep 27, 2024
3fdcf2e
Merge branch 'master' into master
aarcex3 Sep 30, 2024
f480c57
Merge branch 'master' into master
aarcex3 Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions falcon/testing/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@

# NOTE(kgriffs): From the client's perspective, it was a send,
# but the server will be expecting websocket.receive
event = {'type': EventType.WS_RECEIVE} # type: Dict[str, Union[bytes, str]]
# type: Dict[str, Union[bytes, str]]
event = {'type': EventType.WS_RECEIVE}

Check warning on line 681 in falcon/testing/helpers.py

View check run for this annotation

Codecov / codecov/patch

falcon/testing/helpers.py#L681

Added line #L681 was not covered by tests

if data is not None:
event['bytes'] = data
Expand Down Expand Up @@ -942,7 +943,7 @@
"""

http_version = _fixup_http_version(http_version)

raw_path = path

Check warning on line 946 in falcon/testing/helpers.py

View check run for this annotation

Codecov / codecov/patch

falcon/testing/helpers.py#L946

Added line #L946 was not covered by tests
path = uri.decode(path, unquote_plus=False)

# NOTE(kgriffs): Handles both None and ''
Expand All @@ -960,6 +961,7 @@
'http_version': http_version,
'method': method.upper(),
'path': path,
'raw_uri': raw_path,
'query_string': query_string,
}

Expand Down
6 changes: 6 additions & 0 deletions tests/asgi/test_testing_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,9 @@ def test_immediate_disconnect():

with pytest.raises(ConnectionError):
client.simulate_get('/', asgi_disconnect_ttl=0)


def test_create_scope_preserve_raw_uri():
uri = '/cache/http%3A%2F%2Ffalconframework.org/status'
scope = testing.create_scope(path=uri)
assert scope['raw_uri'] == uri
Loading