-
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get rid of intermediate representations of requests and responses
- Loading branch information
Showing
9 changed files
with
346 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
import requests | ||
|
||
BASE_URL = "http://127.0.0.1:8080" | ||
|
||
|
||
def test_binary_output_sync(session): | ||
r = requests.get(f"{BASE_URL}/binary_output_sync") | ||
assert r.status_code == 200 | ||
assert r.headers["Content-Type"] == "application/octet-stream" | ||
assert r.text == "OK" | ||
import pytest | ||
|
||
from http_methods_helpers import get | ||
|
||
def test_binary_output_response_sync(session): | ||
r = requests.get(f"{BASE_URL}/binary_output_response_sync") | ||
assert r.status_code == 200 | ||
assert r.headers["Content-Type"] == "application/octet-stream" | ||
assert r.text == "OK" | ||
|
||
|
||
def test_binary_output_async(session): | ||
r = requests.get(f"{BASE_URL}/binary_output_async") | ||
assert r.status_code == 200 | ||
assert r.headers["Content-Type"] == "application/octet-stream" | ||
assert r.text == "OK" | ||
BASE_URL = "http://127.0.0.1:8080" | ||
|
||
|
||
def test_binary_output_response_async(session): | ||
r = requests.get(f"{BASE_URL}/binary_output_response_async") | ||
assert r.status_code == 200 | ||
@pytest.mark.parametrize( | ||
"route, text", | ||
[ | ||
("/sync/octet", "sync octet"), | ||
("/async/octet", "async octet"), | ||
("/sync/octet/response", "sync octet response"), | ||
("/async/octet/response", "async octet response"), | ||
], | ||
) | ||
def test_binary_output(route: str, text: str, session): | ||
r = get(route) | ||
assert r.headers["Content-Type"] == "application/octet-stream" | ||
assert r.text == "OK" | ||
assert r.text == text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.