Skip to content

Commit

Permalink
matching.py now up to 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud committed Jul 8, 2020
1 parent a0689d2 commit 85e80dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions glom/test/test_check.py
Expand Up @@ -70,6 +70,15 @@ def test_check_basic():
assert repr(exc_info.value)


def test_check_multi():
target = 1
with raises(CheckError) as exc_info:
glom(target, Check(instance_of=float, validate=lambda x: x > 3.14))

assert "2 errors" in str(exc_info.value)



def test_check_signature():
with raises(ValueError):
Check(instance_of=())
Expand Down
1 change: 0 additions & 1 deletion glom/test/test_match.py
Expand Up @@ -162,7 +162,6 @@ def test_and_or_reduction():
assert repr(or_spec) == "Or(T['a'], T['b'], T['c'])"



def test_precedence():
"""test corner cases of dict key precedence"""
glom({(0, 1): 3},
Expand Down

0 comments on commit 85e80dd

Please sign in to comment.