| 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 | |
| 921 | class TestImmutableList: |