[e988c2]: / tests / unit / utils / test_sequence_utils.py

Download this file

17 lines (13 with data), 445 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import pytest
from ehrql.utils.sequence_utils import ordered_set
@pytest.mark.parametrize(
"input_list,expected",
[
([4, 3, 2, 3, 5, 5, 2, 2, 1, 4], [4, 3, 2, 5, 1]),
([4, -1, 3, 3, 2], [4, -1, 3, 2]),
(["f", "d", "f", "f", "d", "e", "f"], ["f", "d", "e"]),
([1, "d", 2, "d", 3, "d"], [1, "d", 2, 3]),
],
)
def test_ordered_set(input_list, expected):
assert ordered_set(input_list) == expected