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

Function test

tests/test_tutorial/test_background_tasks/test_tutorial001.py:13–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12@workdir_lock
13def test():
14 log = Path("log.txt")
15 if log.is_file():
16 os.remove(log) # pragma: no cover
17 response = client.post("/send-notification/foo@example.com")
18 assert response.status_code == 200, response.text
19 assert response.json() == {"message": "Notification sent in the background"}
20 with open("./log.txt") as f:
21 assert "notification for foo@example.com: some notification" 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…