MCPcopy Index your code
hub / github.com/fastapi/fastapi / test

Function test

tests/test_tutorial/test_background_tasks/test_tutorial002.py:26–34  ·  view source on GitHub ↗
(client: TestClient)

Source from the content-addressed store, hash-verified

24
25@workdir_lock
26def test(client: TestClient):
27 log = Path("log.txt")
28 if log.is_file():
29 os.remove(log) # pragma: no cover
30 response = client.post("/send-notification/foo@example.com?q=some-query")
31 assert response.status_code == 200, response.text
32 assert response.json() == {"message": "Message sent"}
33 with open("./log.txt") as f:
34 assert "found query: some-query\nmessage to foo@example.com" in f.read()

Callers

nothing calls this directly

Calls 3

readMethod · 0.80
PathClass · 0.50
postMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…