Skip to content

Commit ee4c67b

Browse files
committed
Add tests for Registry being truthy or falsy.
These already pass due to Mapping using __len__ automatically.
1 parent 06c3279 commit ee4c67b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

referencing/tests/test_core.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ def test_len(self):
111111
)
112112
assert len(registry) == total
113113

114+
def test_bool_empty(self):
115+
assert not Registry()
116+
117+
def test_bool_not_empty(self):
118+
registry = Registry().with_contents(
119+
[(str(i), {"foo": "bar"}) for i in range(3)],
120+
default_specification=Specification.OPAQUE,
121+
)
122+
assert registry
123+
114124
def test_iter(self):
115125
registry = Registry().with_contents(
116126
[(str(i), {"foo": "bar"}) for i in range(8)],

0 commit comments

Comments
 (0)