Skip to content

Commit fa57eb9

Browse files
author
Joel Collins
committed
Improved registry coverage
1 parent 861b8ed commit fa57eb9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_server_types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from labthings.server import types, fields
2+
from labthings.server.types.registry import TypeRegistry, _field_factory
23
import pytest
34

45
from fractions import Fraction
@@ -108,3 +109,12 @@ def test_func(
108109
"untyped": True,
109110
}
110111
assert gen_schema.dump(data) == expected_schema.dump(data)
112+
113+
114+
def test_type_registry():
115+
registry = TypeRegistry()
116+
117+
assert registry.has(str) == True
118+
119+
with pytest.raises(TypeError):
120+
registry.get(object)

0 commit comments

Comments
 (0)