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

Method test_multidict_pop

tests/test_datastructures.py:376–391  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

374 storage_class = ds.MultiDict
375
376 def test_multidict_pop(self):
377 def make_d():
378 return self.storage_class({"foo": [1, 2, 3, 4]})
379
380 d = make_d()
381 assert d.pop("foo") == 1
382 assert not d
383 d = make_d()
384 assert d.pop("foo", 32) == 1
385 assert not d
386 d = make_d()
387 assert d.pop("foos", 32) == 32
388 assert d
389
390 with pytest.raises(KeyError):
391 d.pop("foos")
392
393 def test_multidict_pop_raise_badrequestkeyerror_for_empty_list_value(self):
394 mapping = [("a", "b"), ("a", "c")]

Callers

nothing calls this directly

Calls 1

popMethod · 0.45

Tested by

no test coverage detected