- Sort Score
- Result 10 results
- Languages All
Results 101 - 110 of 1,157 for cassert (0.05 sec)
-
tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py
- response = client.put("/items/5?q=bar", json=None)
- assert response.status_code == 200
- assert response.json() == {"item_id": 5, "q": "bar"}
- @needs_py39
- def test_post_no_body(client: TestClient):
- response = client.put("/items/5", json=None)
- assert response.status_code == 200
- assert response.json() == {"item_id": 5}
- @needs_py39
- def test_post_id_foo(client: TestClient):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 7.6K bytes - Viewed (0) -
tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
- )
- assert response.status_code == 200, response.text
- assert response.json() == {
- "file_size": 14,
- "token": "foo",
- "fileb_content_type": "text/plain",
- }
- def test_openapi_schema(client: TestClient):
- response = client.get("/openapi.json")
- assert response.status_code == 200, response.text
- assert response.json() == {
- "openapi": "3.1.0",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 9.8K bytes - Viewed (0) -
tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py
- )
- assert response.status_code == 200, response.text
- assert response.json() == {
- "file_size": 14,
- "token": "foo",
- "fileb_content_type": "text/plain",
- }
- @needs_py39
- def test_openapi_schema(client: TestClient):
- response = client.get("/openapi.json")
- assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 9.9K bytes - Viewed (0) -
tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py
- def test_swagger_ui():
- response = client.get("/docs")
- assert response.status_code == 200, response.text
- assert (
- '"syntaxHighlight": false' not in response.text
- ), "not used parameters should not be included"
- assert (
- '"syntaxHighlight.theme": "obsidian"' in response.text
- ), "parameters with middle dots should be included in a JSON compatible way"
- assert (
- '"dom_id": "#swagger-ui"' in response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 19 19:54:04 UTC 2023 - 1.5K bytes - Viewed (0) -
tests/test_local_docs.py
- html = get_swagger_ui_html(openapi_url="/docs", title="title")
- body_content = html.body.decode()
- assert swagger_js_url in body_content
- assert swagger_css_url in body_content
- assert swagger_favicon_url in body_content
- def test_strings_in_custom_swagger():
- swagger_js_url = "swagger_fake_file.js"
- swagger_css_url = "swagger_fake_file.css"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Dec 20 18:50:00 UTC 2020 - 2.4K bytes - Viewed (0) -
tests/test_tutorial/test_handling_errors/test_tutorial001.py
- def test_get_item():
- response = client.get("/items/foo")
- assert response.status_code == 200, response.text
- assert response.json() == {"item": "The Foo Wrestlers"}
- def test_get_item_not_found():
- response = client.get("/items/bar")
- assert response.status_code == 404, response.text
- assert response.headers.get("x-error") is None
- assert response.json() == {"detail": "Item not found"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.2K bytes - Viewed (0) -
tests/test_param_include_in_schema.py
- client = TestClient(app)
- response = client.get(path, headers=headers)
- assert response.status_code == expected_status
- assert response.json() == expected_response
- def test_hidden_path():
- client = TestClient(app)
- response = client.get("/hidden_path/hidden_path")
- assert response.status_code == 200
- assert response.json() == {"hidden_path": "hidden_path"}
- @pytest.mark.parametrize(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Mar 26 16:56:53 UTC 2024 - 7.4K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial012.py
- response = client.get("/items/", headers={"X-Token": "invalid"})
- assert response.status_code == 400, response.text
- assert response.json() == {"detail": "X-Token header invalid"}
- def test_get_invalid_one_users():
- response = client.get("/users/", headers={"X-Token": "invalid"})
- assert response.status_code == 400, response.text
- assert response.json() == {"detail": "X-Token header invalid"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 8.4K bytes - Viewed (0) -
tests/test_dependency_duplicates.py
- json={"item": {"data": "myitem"}, "item2": {"data": "myitem2"}},
- )
- assert response.status_code == 200, response.text
- assert response.json() == [{"data": "myitem"}, {"data": "myitem2"}]
- def test_duplicates():
- response = client.post("/with-duplicates", json={"data": "myitem"})
- assert response.status_code == 200, response.text
- assert response.json() == [{"data": "myitem"}, {"data": "myitem"}]
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 8.4K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial002_an_py39.py
- data = websocket.receive_text()
- assert data == f"Message text was: {message}, for item ID: bar"
- message = "Message two"
- websocket.send_text(message)
- data = websocket.receive_text()
- assert data == "Session cookie or query token value is: some-token"
- data = websocket.receive_text()
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 3.9K bytes - Viewed (0)