MCPcopy Create free account
hub / github.com/pallets/werkzeug / test_basic_interface

Method test_basic_interface

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

Source from the content-addressed store, hash-verified

865 storage_class = ds.HeaderSet
866
867 def test_basic_interface(self):
868 hs = self.storage_class()
869 hs.add("foo")
870 hs.add("bar")
871 assert "Bar" in hs
872 assert hs.find("foo") == 0
873 assert hs.find("BAR") == 1
874 assert hs.find("baz") < 0
875 hs.discard("missing")
876 hs.discard("foo")
877 assert hs.find("foo") < 0
878 assert hs.find("bar") == 0
879
880 with pytest.raises(IndexError):
881 hs.index("missing")
882
883 assert hs.index("bar") == 0
884 assert hs
885 hs.clear()
886 assert not hs
887
888
889class TestImmutableList:

Callers

nothing calls this directly

Calls 5

discardMethod · 0.80
addMethod · 0.45
findMethod · 0.45
indexMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected