Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for Equals (0.17 sec)

  1. tests/test_tutorial/test_response_model/test_tutorial004.py

    import pytest
    from dirty_equals import IsDict, IsOneOf
    from fastapi.testclient import TestClient
    
    from docs_src.response_model.tutorial004 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "url,data",
        [
            ("/items/foo", {"name": "Foo", "price": 50.2}),
            (
                "/items/bar",
                {"name": "Bar", "description": "The bartenders", "price": 62, "tax": 20.2},
            ),
            (
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_dependencies/test_tutorial004.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.dependencies.tutorial004 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            (
                "/items",
                200,
                {
                    "items": [
                        {"item_name": "Foo"},
                        {"item_name": "Bar"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.4K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_behind_a_proxy/test_tutorial004.py

    from dirty_equals import IsOneOf
    from fastapi.testclient import TestClient
    
    from docs_src.behind_a_proxy.tutorial004 import app
    
    client = TestClient(app)
    
    
    def test_main():
        response = client.get("/app")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello World", "root_path": "/api/v1"}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_additional_responses/test_tutorial004.py

    import os
    import shutil
    
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.additional_responses.tutorial004 import app
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.get("/items/foo")
        assert response.status_code == 200, response.text
        assert response.json() == {"id": "foo", "value": "there goes my hero"}
    
    
    def test_path_operation_img():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_schema_extra_example/test_tutorial004.py

    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.schema_extra_example.tutorial004 import app
    
    client = TestClient(app)
    
    
    # Test required and embedded body parameters with no bodies sent
    def test_post_body_example():
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
                "description": "A very nice Item",
                "price": 35.4,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 6.9K bytes
    - Viewed (0)
Back to top