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

Method test_basic_interface

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

Source from the content-addressed store, hash-verified

897 storage_class = ds.HeaderSet
898
899 def test_basic_interface(self):
900 hs = self.storage_class()
901 hs.add("foo")
902 hs.add("bar")
903 assert "Bar" in hs
904 assert hs.find("foo") == 0
905 assert hs.find("BAR") == 1
906 assert hs.find("baz") < 0
907 hs.discard("missing")
908 hs.discard("foo")
909 assert hs.find("foo") < 0
910 assert hs.find("bar") == 0
911
912 with pytest.raises(IndexError):
913 hs.index("missing")
914
915 assert hs.index("bar") == 0
916 assert hs
917 hs.clear()
918 assert not hs
919
920
921class 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