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

Method test_update

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

Source from the content-addressed store, hash-verified

774 h.extend({"x": "x"}, {"x": "x"})
775
776 def test_update(self):
777 h = self.storage_class([("a", "0"), ("b", "1"), ("c", "2")])
778 h.update(ds.Headers([("a", "3"), ("a", "4")]))
779 assert h.getlist("a") == ["3", "4"]
780 h.update(b=["5", "6"])
781 assert h.getlist("b") == ["5", "6"]
782 h.update({"c": "7", "d": ["8", "9"]})
783 assert h.getlist("c") == ["7"]
784 assert h.getlist("d") == ["8", "9"]
785 h.update({"c": "10"}, c="11")
786 assert h.getlist("c") == ["11"]
787
788 with pytest.raises(TypeError):
789 h.extend({"x": "x"}, {"x": "x"})
790
791 def test_setlist(self):
792 h = self.storage_class([("a", "0"), ("b", "1"), ("c", "2")])

Callers

nothing calls this directly

Calls 3

updateMethod · 0.45
getlistMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected