Search Options

Results per page
Sort
Preferred Languages
Advance

Results 101 - 110 of 1,157 for cassert (0.05 sec)

  1. tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py

    1. response = client.put("/items/5?q=bar", json=None)
    2. assert response.status_code == 200
    3. assert response.json() == {"item_id": 5, "q": "bar"}
    4.  
    5.  
    6. @needs_py39
    7. def test_post_no_body(client: TestClient):
    8. response = client.put("/items/5", json=None)
    9. assert response.status_code == 200
    10. assert response.json() == {"item_id": 5}
    11.  
    12.  
    13. @needs_py39
    14. 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)
  2. tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

    1. )
    2. assert response.status_code == 200, response.text
    3. assert response.json() == {
    4. "file_size": 14,
    5. "token": "foo",
    6. "fileb_content_type": "text/plain",
    7. }
    8.  
    9.  
    10. def test_openapi_schema(client: TestClient):
    11. response = client.get("/openapi.json")
    12. assert response.status_code == 200, response.text
    13. assert response.json() == {
    14. "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)
  3. tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py

    1. )
    2. assert response.status_code == 200, response.text
    3. assert response.json() == {
    4. "file_size": 14,
    5. "token": "foo",
    6. "fileb_content_type": "text/plain",
    7. }
    8.  
    9.  
    10. @needs_py39
    11. def test_openapi_schema(client: TestClient):
    12. response = client.get("/openapi.json")
    13. 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)
  4. tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py

    1. def test_swagger_ui():
    2. response = client.get("/docs")
    3. assert response.status_code == 200, response.text
    4. assert (
    5. '"syntaxHighlight": false' not in response.text
    6. ), "not used parameters should not be included"
    7. assert (
    8. '"syntaxHighlight.theme": "obsidian"' in response.text
    9. ), "parameters with middle dots should be included in a JSON compatible way"
    10. assert (
    11. '"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)
  5. tests/test_local_docs.py

    1. html = get_swagger_ui_html(openapi_url="/docs", title="title")
    2. body_content = html.body.decode()
    3. assert swagger_js_url in body_content
    4. assert swagger_css_url in body_content
    5. assert swagger_favicon_url in body_content
    6.  
    7.  
    8. def test_strings_in_custom_swagger():
    9. swagger_js_url = "swagger_fake_file.js"
    10. 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)
  6. tests/test_tutorial/test_handling_errors/test_tutorial001.py

    1.  
    2. def test_get_item():
    3. response = client.get("/items/foo")
    4. assert response.status_code == 200, response.text
    5. assert response.json() == {"item": "The Foo Wrestlers"}
    6.  
    7.  
    8. def test_get_item_not_found():
    9. response = client.get("/items/bar")
    10. assert response.status_code == 404, response.text
    11. assert response.headers.get("x-error") is None
    12. assert response.json() == {"detail": "Item not found"}
    13.  
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  7. tests/test_param_include_in_schema.py

    1. client = TestClient(app)
    2. response = client.get(path, headers=headers)
    3. assert response.status_code == expected_status
    4. assert response.json() == expected_response
    5.  
    6.  
    7. def test_hidden_path():
    8. client = TestClient(app)
    9. response = client.get("/hidden_path/hidden_path")
    10. assert response.status_code == 200
    11. assert response.json() == {"hidden_path": "hidden_path"}
    12.  
    13.  
    14. @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)
  8. tests/test_tutorial/test_dependencies/test_tutorial012.py

    1. response = client.get("/items/", headers={"X-Token": "invalid"})
    2. assert response.status_code == 400, response.text
    3. assert response.json() == {"detail": "X-Token header invalid"}
    4.  
    5.  
    6. def test_get_invalid_one_users():
    7. response = client.get("/users/", headers={"X-Token": "invalid"})
    8. assert response.status_code == 400, response.text
    9. assert response.json() == {"detail": "X-Token header invalid"}
    10.  
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  9. tests/test_dependency_duplicates.py

    1. json={"item": {"data": "myitem"}, "item2": {"data": "myitem2"}},
    2. )
    3. assert response.status_code == 200, response.text
    4. assert response.json() == [{"data": "myitem"}, {"data": "myitem2"}]
    5.  
    6.  
    7. def test_duplicates():
    8. response = client.post("/with-duplicates", json={"data": "myitem"})
    9. assert response.status_code == 200, response.text
    10. assert response.json() == [{"data": "myitem"}, {"data": "myitem"}]
    11.  
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_websockets/test_tutorial002_an_py39.py

    1. data = websocket.receive_text()
    2. assert data == f"Message text was: {message}, for item ID: bar"
    3. message = "Message two"
    4. websocket.send_text(message)
    5. data = websocket.receive_text()
    6. assert data == "Session cookie or query token value is: some-token"
    7. 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)
Back to top