Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 624 for test (0.14 sec)

  1. scripts/test.sh

    #!/usr/bin/env bash
    
    set -e
    set -x
    
    export PYTHONPATH=./docs_src
    Shell Script
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 21:38:15 GMT 2023
    - 99 bytes
    - Viewed (3)
  2. .github/workflows/test.yml

          - name: Install Dependencies
            if: steps.cache.outputs.cache-hit != 'true'
            run: pip install -r requirements-tests.txt
          - name: Install Pydantic v2
            run: pip install "pydantic>=2.0.2,<3.0.0"
          - name: Lint
            run: bash scripts/lint.sh
    
      test:
        runs-on: ubuntu-latest
        strategy:
    Others
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 4.4K bytes
    - Viewed (1)
  3. tests/test_tutorial/test_settings/test_app02.py

    from ...utils import needs_pydanticv2
    
    
    @needs_pydanticv2
    def test_settings(monkeypatch: MonkeyPatch):
        from docs_src.settings.app02 import main
    
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        settings = main.get_settings()
        assert settings.app_name == "Awesome API"
        assert settings.items_per_user == 50
    
    
    @needs_pydanticv2
    def test_override_settings():
        from docs_src.settings.app02 import test_main
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 488 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_files/test_tutorial002.py

                files=(
                    ("files", ("test.txt", file)),
                    ("files", ("test2.txt", file2)),
                ),
            )
        assert response.status_code == 200, response.text
        assert response.json() == {"file_sizes": [14, 15]}
    
    
    def test_post_upload_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        path2 = tmp_path / "test2.txt"
        path2.write_bytes(b"<file content2>")
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  5. docs_src/app_testing/app_b/test_main.py

    from .main import app
    
    client = TestClient(app)
    
    
    def test_read_item():
        response = client.get("/items/foo", headers={"X-Token": "coneofsilence"})
        assert response.status_code == 200
        assert response.json() == {
            "id": "foo",
            "title": "Foo",
            "description": "There goes my hero",
        }
    
    
    def test_read_item_bad_token():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_files/test_tutorial003.py

                    ("files", ("test.txt", file)),
                    ("files", ("test2.txt", file2)),
                ),
            )
        assert response.status_code == 200, response.text
        assert response.json() == {"filenames": ["test.txt", "test2.txt"]}
    
    
    def test_get_root():
        client = TestClient(app)
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert b"<form" in response.content
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  7. .github/workflows/test-redistribute.yml

            run: |
              cd dist
              tar xvf fastapi*.tar.gz
          - name: Install test dependencies
            run: |
              cd dist/fastapi-*/
              pip install -r requirements-tests.txt
          - name: Run source distribution tests
            run: |
              cd dist/fastapi-*/
              bash scripts/test.sh
          - name: Build wheel distribution
            run: |
              cd dist
    Others
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 28 23:28:07 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_dependencies/test_tutorial008d.py

        return client
    
    
    def test_get_no_item(client: TestClient):
        response = client.get("/items/foo")
        assert response.status_code == 404, response.text
        assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
    
    
    def test_get(client: TestClient):
        response = client.get("/items/plumbus")
        assert response.status_code == 200, response.text
        assert response.json() == "plumbus"
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_request_forms/test_tutorial001.py

        client = TestClient(app)
        return client
    
    
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
        assert response.json() == {"username": "Foo"}
    
    
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_path_params/test_tutorial005.py

    from docs_src.path_params.tutorial005 import app
    
    client = TestClient(app)
    
    
    def test_get_enums_alexnet():
        response = client.get("/models/alexnet")
        assert response.status_code == 200
        assert response.json() == {"model_name": "alexnet", "message": "Deep Learning FTW!"}
    
    
    def test_get_enums_lenet():
        response = client.get("/models/lenet")
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 5K bytes
    - Viewed (0)
Back to top