- Sort Score
- Result 10 results
- Languages All
Results 301 - 310 of 1,452 for DEF (0.04 sec)
-
build-logic/documentation/src/test/groovy/gradlebuild/docs/dsl/source/model/MethodMetaDataTest.groovy
def notDeprecated = new MethodMetaData('param', owner) def deprecated = new MethodMetaData('param', owner) deprecated.addAnnotationTypeName(Deprecated.class.name) expect: !notDeprecated.deprecated deprecated.deprecated } def "is incubating when @Incubating is attached to method"() { def notIncubating = new MethodMetaData('param', owner)
Registered: Wed Nov 06 11:36:14 UTC 2024 - Last Modified: Wed Dec 09 08:14:05 UTC 2020 - 5.6K bytes - Viewed (0) -
tests/test_path.py
client = TestClient(app) def test_text_get(): response = client.get("/text") assert response.status_code == 200, response.text assert response.json() == "Hello World" def test_nonexistent(): response = client.get("/nonexistent") assert response.status_code == 404, response.text assert response.json() == {"detail": "Not Found"} def test_path_foobar():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 34.4K bytes - Viewed (0) -
tests/test_response_model_as_return_annotation.py
@app.get("/no_response_model-no_annotation-return_model") def no_response_model_no_annotation_return_model(): return User(name="John", surname="Doe") @app.get("/no_response_model-no_annotation-return_dict") def no_response_model_no_annotation_return_dict(): return {"name": "John", "surname": "Doe"} @app.get("/response_model-no_annotation-return_same_model", response_model=User) def response_model_no_annotation_return_same_model():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Mon Aug 14 09:49:57 UTC 2023 - 47.7K bytes - Viewed (0) -
tests/test_tutorial/test_handling_errors/test_tutorial004.py
in response.text ) def test_get_http_error(): response = client.get("/items/3") assert response.status_code == 418, response.text assert response.content == b"Nope! I don't like 3." def test_get(): response = client.get("/items/2") assert response.status_code == 200, response.text assert response.json() == {"item_id": 2} def test_openapi_schema():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 3.7K bytes - Viewed (0) -
docs_src/background_tasks/tutorial002_an_py310.py
app = FastAPI() def write_log(message: str): with open("log.txt", mode="a") as log: log.write(message) def get_query(background_tasks: BackgroundTasks, q: str | None = None): if q: message = f"found query: {q}\n" background_tasks.add_task(write_log, message) return q @app.post("/send-notification/{email}") async def send_notification(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 683 bytes - Viewed (0) -
tests/test_openapi_route_extensions.py
app = FastAPI() @app.get("/", openapi_extra={"x-custom-extension": "value"}) def route_with_extras(): return {} client = TestClient(app) def test_get_route(): response = client.get("/") assert response.status_code == 200, response.text assert response.json() == {} def test_openapi(): response = client.get("/openapi.json")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1.1K bytes - Viewed (0) -
tests/test_swagger_ui_init_oauth.py
swagger_ui_init_oauth = {"clientId": "the-foo-clients", "appName": "The Predendapp"} app = FastAPI(swagger_ui_init_oauth=swagger_ui_init_oauth) @app.get("/items/") async def read_items(): return {"id": "foo"} client = TestClient(app) def test_swagger_ui(): response = client.get("/docs") assert response.status_code == 200, response.text print(response.text) assert "ui.initOAuth" in response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Aug 09 10:54:05 UTC 2020 - 718 bytes - Viewed (0) -
tests/test_tutorial/test_additional_status_codes/test_tutorial001_an_py310.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 @pytest.fixture(name="client") def get_client(): from docs_src.additional_status_codes.tutorial001_an_py310 import app client = TestClient(app) return client @needs_py310 def test_update(client: TestClient): response = client.put("/items/foo", json={"name": "Wrestlers"}) assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 741 bytes - Viewed (0) -
build-logic/build-update-utils/src/test/groovy/gradlebuild/buildutils/tasks/UpdateReleasedVersionsIntegrationTest.groovy
class UpdateReleasedVersionsIntegrationTest extends Specification { def format = new SimpleDateFormat('yyyyMMddHHmmssZ') @TempDir File tmpDir def setup() { format.timeZone = TimeZone.getTimeZone("UTC") } def "updated released version file has expected format"() { given: def releasedVersionsFile = new File(tmpDir, "released-versions.json")
Registered: Wed Nov 06 11:36:14 UTC 2024 - Last Modified: Tue Aug 17 08:32:56 UTC 2021 - 2.4K bytes - Viewed (0) -
build-logic/documentation/src/test/groovy/gradlebuild/docs/dsl/source/model/TypeMetaDataTest.groovy
final TypeMetaData type = new TypeMetaData('org.gradle.SomeType') def rawTypeForSimpleType() { expect: type.rawType.signature == 'org.gradle.SomeType' } def rawTypeForArrayType() { type.arrayDimensions = 2 expect: type.rawType.signature == 'org.gradle.SomeType[][]' } def rawTypeForVarargsType() { when: type.setVarargs()
Registered: Wed Nov 06 11:36:14 UTC 2024 - Last Modified: Wed Dec 09 08:14:05 UTC 2020 - 4.6K bytes - Viewed (0)