Skip to content

Commit

Permalink
test ImmutableTypedDict
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinKonowalczyk committed Apr 26, 2024
1 parent f493b15 commit b7ca09a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_datastructures.py
Expand Up @@ -304,6 +304,19 @@ def test_dict_is_hashable(self):
assert immutable in x
assert immutable2 in x

def test_get_does_not_raise(self):
cls = self.storage_class
immutable = cls({"a": 1})
assert immutable.get("a") == 1

def test_pop_raises(self):
cls = self.storage_class
immutable = cls({"a": 1})
with pytest.raises(TypeError):
immutable.pop("a")
with pytest.raises(TypeError):
immutable.popitem()


class TestImmutableTypeConversionDict(_ImmutableDictTests):
storage_class = ds.ImmutableTypeConversionDict
Expand Down

0 comments on commit b7ca09a

Please sign in to comment.