Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 1,099 for assertIn (0.08 sec)

  1. tests/test_tutorial/test_sql_databases/test_tutorial002.py

            response = client.post(
                "/heroes/", json={"name": "Rusty-Man", "secret_name": "Tommy Sharp"}
            )
            assert response.status_code == 200, response.text
    
            response = client.get("/heroes/")
            assert response.status_code == 200, response.text
            assert response.json() == snapshot(
                [
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 19.9K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_security/test_tutorial001_an.py

        response = client.get("/items")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token():
        response = client.get("/items", headers={"Authorization": "Bearer testtoken"})
        assert response.status_code == 200, response.text
        assert response.json() == {"token": "testtoken"}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  3. tests/test_security_http_basic_optional.py

        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == "Basic"
        assert response.json() == {"detail": "Invalid authentication credentials"}
    
    
    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
    - 2.6K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_form_models/test_tutorial002_pv1_an.py

        assert response.status_code == 200
        assert response.json() == {"username": "Foo", "password": "secret"}
    
    
    # TODO: remove when deprecating Pydantic v1
    @needs_pydanticv1
    def test_post_body_extra_form(client: TestClient):
        response = client.post(
            "/login/", data={"username": "Foo", "password": "secret", "extra": "extra"}
        )
        assert response.status_code == 422
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 06 17:31:18 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_form_models/test_tutorial002.py

        assert response.status_code == 200
        assert response.json() == {"username": "Foo", "password": "secret"}
    
    
    @needs_pydanticv2
    def test_post_body_extra_form(client: TestClient):
        response = client.post(
            "/login/", data={"username": "Foo", "password": "secret", "extra": "extra"}
        )
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 06 17:31:18 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  6. okhttp-brotli/src/test/java/okhttp3/brotli/BrotliInterceptorTest.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.brotli
    
    import assertk.assertThat
    import assertk.assertions.contains
    import assertk.assertions.hasMessage
    import assertk.assertions.isEmpty
    import assertk.assertions.isEqualTo
    import java.io.IOException
    import kotlin.test.assertFailsWith
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.Protocol
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_security/test_tutorial001.py

        response = client.get("/items")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token():
        response = client.get("/items", headers={"Authorization": "Bearer testtoken"})
        assert response.status_code == 200, response.text
        assert response.json() == {"token": "testtoken"}
    
    
    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_tutorial/test_cors/test_tutorial001.py

        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Hello World"}
        assert (
            response.headers["access-control-allow-origin"]
            == "https://localhost.tiangolo.com"
        )
    
        # Test non-CORS response
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Hello World"}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 1.2K bytes
    - Viewed (0)
  9. mockwebserver-junit5/src/test/java/mockwebserver3/junit5/internal/ExtensionMultipleInstancesTest.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package mockwebserver3.junit5.internal
    
    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import assertk.assertions.isNotEqualTo
    import assertk.assertions.isTrue
    import mockwebserver3.MockWebServer
    import org.junit.jupiter.api.AfterEach
    import org.junit.jupiter.api.BeforeEach
    import org.junit.jupiter.api.Test
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Jan 14 10:20:09 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_sql_databases/test_tutorial001.py

            assert response.status_code == 200, response.text
            assert response.json() == snapshot({"ok": True})
    
            response = client.get(f"/heroes/{hero_id}")
            assert response.status_code == 404, response.text
    
            response = client.delete(f"/heroes/{hero_id}")
            assert response.status_code == 404, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 14.8K bytes
    - Viewed (0)
Back to top