Skip to content

Commit

Permalink
more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
pontushojer committed Oct 13, 2023
1 parent d8d1b26 commit 5b4d956
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,25 @@ def test_union_dict_combine_different_fails():

with pytest.raises(ValueError):
d2.combine(d1)


def test_union_dict_combine_wrong_type_fails():
d1 = UnionDict(set)
d1["a"].union({1, 2, 3})
d1["b"].union({7, 8, 9})

with pytest.raises(TypeError):
d1.combine(None)


def test_union_dict_combine_wrong_default_factory_fails():
d1 = UnionDict(set)
d1["a"].union({1, 2, 3})
d1["b"].union({7, 8, 9})

d2 = UnionDict(int)
d2["a"] = 1
d2["b"] = 2

with pytest.raises(ValueError):
d1.combine(d2)

0 comments on commit 5b4d956

Please # to comment.