MCPcopy
hub / github.com/encode/starlette / test_staticfiles_with_package

Function test_staticfiles_with_package

tests/test_staticfiles.py:68–79  ·  view source on GitHub ↗
(test_client_factory: TestClientFactory)

Source from the content-addressed store, hash-verified

66
67
68def test_staticfiles_with_package(test_client_factory: TestClientFactory) -> None:
69 app = StaticFiles(packages=["tests"])
70 client = test_client_factory(app)
71 response = client.get("/example.txt")
72 assert response.status_code == 200
73 assert response.text == "123\n"
74
75 app = StaticFiles(packages=[("tests", "statics")])
76 client = test_client_factory(app)
77 response = client.get("/example.txt")
78 assert response.status_code == 200
79 assert response.text == "123\n"
80
81
82def test_staticfiles_post(tmpdir: Path, test_client_factory: TestClientFactory) -> None:

Callers

nothing calls this directly

Calls 3

StaticFilesClass · 0.90
test_client_factoryFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected