Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Oct 24, 2024
1 parent 93b57de commit dc37db8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/test_crc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ def test_signature_crc_funcs(name: str) -> None:


def test_type_hint_reader() -> None:
signature = _get_signature()
# Literal
available = [n for n in dir(crc_module) if not n.startswith('_')]
hint = typing.get_type_hints(SmlStreamReader.__init__)
literal = hint['crc']
literal_values = typing.get_args(literal)
assert set(available) == set(literal_values)

# crc_func variable
signature = _get_signature()
a = SmlStreamReader()
hint = typing.get_type_hints(a.crc_func)
assert hint.pop('return') is signature.return_annotation
Expand All @@ -51,12 +58,6 @@ def test_type_hint_reader() -> None:
for name in hint:
assert hint[name] == signature.parameters[name].annotation

# Literal
available = [n for n in dir(crc_module) if not n.startswith('_')]
hint = typing.get_type_hints(SmlStreamReader.__init__)
literal = hint['crc']
literal_values = typing.get_args(literal)
assert set(available) == set(literal_values)


def test_invalid_crc_name() -> None:
Expand Down

0 comments on commit dc37db8

Please sign in to comment.