Debian Codegraph @

recurring_ical_events/test/test_util_functions.py

raw symbols SCIP
1 """Check some utility functions."""
2
3 from typing import NamedTuple
4
5 import pytest
6
7 from recurring_ical_events.util import with_highest_sequence
8
9
10 class Component(NamedTuple):
11 sequence: int
12
13
14 @pytest.mark.parametrize(
15 ("a1", "a2", "result"),
16 [
17 (None, None, None),
18 (Component(1), Component(2), Component(2)),
19 (Component(5), Component(2), Component(5)),
20 (Component(1), None, Component(1)),
21 (None, Component(4), Component(4)),
22 (None, Component(-3), Component(-3)),
23 (Component(-1), None, Component(-1)),
24 ],
25 )
26 def test_highest_sequence(a1, a2, result):
27 """Check the result"""
28 assert with_highest_sequence(a1, a2) == result