MCPcopy
hub / github.com/pallets/werkzeug / test_no_cache_conditional_default

Function test_no_cache_conditional_default

tests/test_send_file.py:127–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125
126
127def test_no_cache_conditional_default():
128 rv = send_file(
129 txt_path,
130 EnvironBuilder(
131 headers={"If-Modified-Since": http_date(datetime.datetime(2020, 7, 12))}
132 ).get_environ(),
133 last_modified=datetime.datetime(2020, 7, 11),
134 )
135 rv.close()
136 assert "no-cache" in rv.headers["Cache-Control"]
137 assert not rv.cache_control.public
138 assert not rv.cache_control.max_age
139 assert not rv.expires
140 assert rv.status_code == 304
141
142
143@pytest.mark.parametrize(("value", "public"), [(0, False), (60, True)])

Callers

nothing calls this directly

Calls 5

send_fileFunction · 0.90
EnvironBuilderClass · 0.90
http_dateFunction · 0.90
get_environMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected