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

Method test_accept

tests/test_http.py:19–25  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17
18class TestHTTPUtility:
19 def test_accept(self):
20 a = http.parse_accept_header("en-us,ru;q=0.5")
21 assert list(a.values()) == ["en-us", "ru"]
22 assert a.best == "en-us"
23 assert a.find("ru") == 1
24 pytest.raises(ValueError, a.index, "de")
25 assert a.to_header() == "en-us,ru;q=0.5"
26
27 def test_accept_parameter_with_space(self):
28 a = http.parse_accept_header('application/x-special; z="a b";q=0.5')

Callers

nothing calls this directly

Calls 4

listFunction · 0.50
valuesMethod · 0.45
findMethod · 0.45
to_headerMethod · 0.45

Tested by

no test coverage detected