Search Options

Results per page
Sort
Preferred Languages
Advance

Results 291 - 300 of 1,036 for AssertJ (0.05 sec)

  1. tests/test_tutorial/test_handling_errors/test_tutorial005.py

    def test_post():
        data = {"title": "towel", "size": 5}
        response = client.post("/items/", json=data)
        assert response.status_code == 200, response.text
        assert response.json() == data
    
    
    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"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  2. samples/compare/src/test/kotlin/okhttp3/compare/JettyHttpClientTest.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.compare
    
    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import assertk.assertions.isNull
    import assertk.assertions.matches
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import org.eclipse.jetty.client.HttpClient
    import org.junit.jupiter.api.AfterEach
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_wsgi/test_tutorial001.py

    client = TestClient(app)
    
    
    def test_flask():
        response = client.get("/v1/")
        assert response.status_code == 200, response.text
        assert response.text == "Hello, World from Flask!"
    
    
    def test_app():
        response = client.get("/v2")
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 436 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_response_model/test_tutorial006_py310.py

        response = client.get("/items/bar/name")
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Bar", "description": "The Bar fighters"}
    
    
    @needs_py310
    def test_read_item_public_data(client: TestClient):
        response = client.get("/items/bar/public")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "Bar",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 04 20:47:07 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_metadata/test_tutorial001.py

    client = TestClient(app)
    
    
    def test_items():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"name": "Katana"}]
    
    
    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": "ChimichangApp",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_behind_a_proxy/test_tutorial003.py

    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
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_extra_models/test_tutorial004.py

        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [
            {"name": "Foo", "description": "There comes my hero"},
            {"name": "Red", "description": "It's my aeroplane"},
        ]
    
    
    def test_openapi_schema():
        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: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  8. tests/test_enforce_once_required_parameter.py

                }
            }
        },
    }
    
    
    def test_schema():
        response = client.get("/openapi.json")
        assert response.status_code == status.HTTP_200_OK
        actual_schema = response.json()
        assert actual_schema == expected_schema
    
    
    def test_get_invalid():
        response = client.get("/foo")
        assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
    
    
    def test_get_valid():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  9. tests/test_annotated.py

        response = client.get("/test1")
        assert response.status_code == 200
        assert response.json() == {"foo": "bar"}
    
        response = client.get("/test1", params={"var": "baz"})
        assert response.status_code == 200
        assert response.json() == {"foo": "baz"}
    
        response = client.get("/test2")
        assert response.status_code == 200
        assert response.json() == {"foo": "bar"}
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_request_form_models/test_tutorial001.py

        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
        assert response.json() == {"username": "Foo", "password": "secret"}
    
    
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
                    {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 05 15:16:50 UTC 2024
    - 7.4K bytes
    - Viewed (0)
Back to top