summaryrefslogtreecommitdiff
path: root/tests/test_object.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_object.py')
-rw-r--r--tests/test_object.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_object.py b/tests/test_object.py
index 601fa07..67d21af 100644
--- a/tests/test_object.py
+++ b/tests/test_object.py
@@ -160,6 +160,20 @@ def test_name_equality():
assert Name.Foo == Name('/Foo')
+def test_dictionary_contains():
+ d = Dictionary({
+ '/Monty': 'Python',
+ '/Flying': 'Circus'
+ })
+ assert Name.Flying in d
+ assert Name('/Monty') in d
+ assert Name.Brian not in d
+
+
+def test_unslashed_name():
+ with pytest.raises(ValueError, match='must begin with'):
+ Name('Monty') not in d
+
class TestHashViolation:
def check(self, a, b):