MCPcopy Create free account
hub / github.com/0x676e67/wreq-python / test_edge_cases

Function test_edge_cases

tests/header_map_test.py:94–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92
93@pytest.mark.flaky(reruns=3, reruns_delay=2)
94def test_edge_cases():
95 h = HeaderMap()
96 h.remove("nope")
97 assert h.get("nope") is None
98 assert list(h.get_all("nope")) == []
99 try:
100 del h["nope"]
101 except KeyError:
102 pass
103 h.append("X", "1")
104 assert h["X"] == b"1"
105 h.append("X", "2")
106 # hash is randomized, so we check both possible orders
107 assert len(h) == 2
108 assert (list(h.get_all("X")) == [b"1", b"2"]) or (
109 list(h.get_all("X")) == [b"2", b"1"]
110 )
111
112
113@pytest.mark.flaky(reruns=3, reruns_delay=2)

Callers

nothing calls this directly

Calls 5

removeMethod · 0.95
getMethod · 0.95
get_allMethod · 0.95
appendMethod · 0.95
HeaderMapClass · 0.85

Tested by

no test coverage detected