Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 1,489 for Assert (0.17 sec)

  1. tests/test_tutorial/test_events/test_tutorial003.py

        ml_models,
    )
    
    
    def test_events():
        assert not ml_models, "ml_models should be empty"
        with TestClient(app) as client:
            assert ml_models["answer_to_everything"] == fake_answer_to_everything_ml_model
            response = client.get("/predict", params={"x": 2})
            assert response.status_code == 200, response.text
            assert response.json() == {"result": 84.0}
        assert not ml_models, "ml_models should be empty"
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py

        response = client.get("/items/")
        assert response.status_code == 200
        assert response.json() == {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
    
    
    @needs_py39
    def test_query_params_str_validations_item_query_fixedquery(client: TestClient):
        response = client.get("/items/", params={"item-query": "fixedquery"})
        assert response.status_code == 200
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_custom_request_and_route/test_tutorial003.py

    
    def test_get():
        response = client.get("/")
        assert response.json() == {"message": "Not timed"}
        assert "X-Response-Time" not in response.headers
    
    
    def test_get_timed():
        response = client.get("/timed")
        assert response.json() == {"message": "It's the time of my life"}
        assert "X-Response-Time" in response.headers
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 526 bytes
    - Viewed (0)
  4. android/guava-testlib/src/com/google/common/escape/testing/EscaperAsserts.java

        // Escapers operate on characters: no characters, no escaping.
        Assert.assertEquals("", escaper.escape(""));
        // Assert that escapers throw null pointer exceptions.
        try {
          escaper.escape((String) null);
          Assert.fail("exception not thrown when escaping a null string");
        } catch (NullPointerException e) {
          // pass
        }
      }
    
      /**
       * Asserts that an escaper escapes the given character into the expected string.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 18 20:55:09 GMT 2022
    - 3.8K bytes
    - Viewed (0)
  5. docs_src/dependency_testing/tutorial001_an_py39.py

    def test_override_in_items():
        response = client.get("/items/")
        assert response.status_code == 200
        assert response.json() == {
            "message": "Hello Items!",
            "params": {"q": None, "skip": 5, "limit": 10},
        }
    
    
    def test_override_in_items_with_q():
        response = client.get("/items/?q=foo")
        assert response.status_code == 200
        assert response.json() == {
            "message": "Hello Items!",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  6. tests/test_security_api_key_query.py

    
    def test_security_api_key():
        response = client.get("/users/me?key=secret")
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "secret"}
    
    
    def test_security_api_key_no_key():
        response = client.get("/users/me")
        assert response.status_code == 403, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py

        response = client.put("/items/5?q=bar", json=None)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5, "q": "bar"}
    
    
    @needs_py310
    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_py310
    def test_post_id_foo(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_async_sql_databases/test_tutorial001.py

            response = client.post("/notes/", json=note)
            assert response.status_code == 200, response.text
            data = response.json()
            assert data["text"] == note["text"]
            assert data["completed"] == note["completed"]
            assert "id" in data
            response = client.get("/notes/")
            assert response.status_code == 200, response.text
            assert data in response.json()
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 6K bytes
    - Viewed (0)
  9. tests/test_security_api_key_cookie_description.py

        response = client.get("/users/me")
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "secret"}
    
    
    def test_security_api_key_no_key():
        client = TestClient(app)
        response = client.get("/users/me")
        assert response.status_code == 403, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  10. tests/test_security_api_key_cookie_optional.py

        response = client.get("/users/me")
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "secret"}
    
    
    def test_security_api_key_no_key():
        client = TestClient(app)
        response = client.get("/users/me")
        assert response.status_code == 200, response.text
        assert response.json() == {"msg": "Create an account first"}
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.1K bytes
    - Viewed (0)
Back to top