MCPcopy
hub / github.com/sanic-org/sanic / test_bp_static

Function test_bp_static

tests/test_blueprints.py:566–579  ·  view source on GitHub ↗
(app: Sanic)

Source from the content-addressed store, hash-verified

564
565
566def test_bp_static(app: Sanic):
567 current_file = inspect.getfile(inspect.currentframe())
568 with open(current_file, "rb") as file:
569 current_file_contents = file.read()
570
571 blueprint = Blueprint("test_static")
572
573 blueprint.static("/testing.file", current_file)
574
575 app.blueprint(blueprint)
576
577 request, response = app.test_client.get("/testing.file")
578 assert response.status == 200
579 assert response.body == current_file_contents
580
581
582@pytest.mark.parametrize("file_name", ["test.html"])

Callers

nothing calls this directly

Calls 5

BlueprintClass · 0.90
staticMethod · 0.80
blueprintMethod · 0.80
readMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…