Search Options

Results per page
Sort
Preferred Languages
Advance

Results 371 - 380 of 1,100 for Upsert (0.03 sec)

  1. docs_src/app_testing/tutorial004_py39.py

        # Before the lifespan starts, "items" is still empty
        assert items == {}
    
        with TestClient(app) as client:
            # Inside the "with TestClient" block, the lifespan starts and items added
            assert items == {"foo": {"name": "Fighters"}, "bar": {"name": "Tenders"}}
    
            response = client.get("/items/foo")
            assert response.status_code == 200
            assert response.json() == {"name": "Fighters"}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_body/test_tutorial004.py

        )
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 123,
            "name": "Foo",
            "price": 50.1,
            "description": None,
            "tax": None,
        }
    
    
    def test_put_with_no_data(client: TestClient):
        response = client.put("/items/123", json={})
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 6K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_encoder/test_tutorial001.py

            json={
                "title": "Foo",
                "timestamp": "2023-01-01T12:00:00",
                "description": "An optional description",
            },
        )
        assert response.status_code == 200
        assert "123" in fake_db
        assert fake_db["123"] == {
            "title": "Foo",
            "timestamp": "2023-01-01T12:00:00",
            "description": "An optional description",
        }
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  4. tests/test_return_none_stringified_annotations.py

        def return_no_content() -> "None":
            return
    
        client = TestClient(app)
        response = client.get("/no-content")
        assert response.status_code == http.HTTPStatus.NO_CONTENT, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Sep 20 18:44:43 UTC 2025
    - 431 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_response_headers/test_tutorial002.py

    from docs_src.response_headers.tutorial002_py39 import app
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.get("/headers-and-object/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Hello World"}
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 383 bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb/SmbEndOfFileExceptionTest.java

         */
        @Test
        void defaultConstructorSetsMessageAndStatus() {
            // Arrange & Act
            SmbEndOfFileException ex = new SmbEndOfFileException();
    
            // Assert
            assertEquals("Unexpectedly reached end of file", ex.getMessage(), "Default message must match");
            assertEquals(NtStatus.NT_STATUS_UNSUCCESSFUL, ex.getNtStatus(), "Default NT status should be UNSUCCESSFUL");
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 2.4K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_testing/test_tutorial001.py

    from docs_src.app_testing.tutorial001_py39 import client, test_read_main
    
    
    def test_main():
        test_read_main()
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/": {
                    "get": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 826 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_openapi_callbacks/test_tutorial001.py

        )
        assert response.status_code == 200, response.text
        assert response.json() == {"msg": "Invoice received"}
    
    
    def test_dummy_callback(mod: ModuleType):
        # Just for coverage
        mod.invoice_notification({})
    
    
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.6K bytes
    - Viewed (0)
  9. tests/test_security_http_base_optional.py

        response = client.get("/users/me", headers={"Authorization": "Other foobar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"scheme": "Other", "credentials": "foobar"}
    
    
    def test_security_http_base_no_credentials():
        response = client.get("/users/me")
        assert response.status_code == 200, response.text
        assert response.json() == {"msg": "Create an account first"}
    
    
    def test_openapi_schema():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  10. tests/test_security_oauth2_authorization_code_bearer_scopes_openapi_simple.py

        response = client.get("/admin", headers={"Authorization": "Bearer faketoken"})
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Admin Access"}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == snapshot(
            {
                "openapi": "3.1.0",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 2.6K bytes
    - Viewed (0)
Back to top