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