Skip to content

Commit 05642d3

Browse files
committed
Update types in deep_merge test
1 parent 1edf957 commit 05642d3

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

tests/unit_tests/test_utils.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import pytest
44

5+
from maison import types
56
from maison.utils import deep_merge
67

78

@@ -12,32 +13,32 @@ class TestDeepMerge:
1213
("a", "b", "expected"),
1314
[
1415
pytest.param(
15-
{1: 2, 3: 4},
16-
{3: 5, 6: 7},
17-
{1: 2, 3: 5, 6: 7},
16+
{"1": "2", "3": "4"},
17+
{"3": "5", "6": "7"},
18+
{"1": "2", "3": "5", "6": "7"},
1819
id="simple",
1920
),
2021
pytest.param(
21-
{1: 2, 3: {4: 5, 6: 7}},
22-
{3: {6: 8, 9: 10}, 11: 12},
23-
{1: 2, 3: {4: 5, 6: 8, 9: 10}, 11: 12},
22+
{"1": "2", "3": {"4": "5", "6": "7"}},
23+
{"3": {"6": "8", "9": "10"}, "11": "12"},
24+
{"1": "2", "3": {"4": "5", "6": "8", "9": "10"}, "11": "12"},
2425
id="nested",
2526
),
2627
],
2728
)
2829
def test_success(
2930
self,
30-
a: dict[int, int],
31-
b: dict[int, int],
32-
expected: dict[int, int],
31+
a: types.ConfigValues,
32+
b: types.ConfigValues,
33+
expected: types.ConfigValues,
3334
) -> None:
3435
assert deep_merge(a, b) == expected
3536
assert a == expected
3637

3738
def test_incompatible_dicts(self) -> None:
3839
"""Trying to merge incompatible dicts returns an error"""
39-
dict_a = {1: 2, 2: 5}
40-
dict_b = {1: {3: 4}}
40+
dict_a: types.ConfigValues = {"1": "2", "2": "5"}
41+
dict_b: types.ConfigValues = {"1": {"3": "4"}}
4142

4243
with pytest.raises(RuntimeError):
43-
deep_merge(dict_a, dict_b)
44+
_ = deep_merge(dict_a, dict_b)

0 commit comments

Comments
 (0)