Increase coverage a bit

This commit is contained in:
stijndcl 2022-09-03 01:26:32 +02:00
parent 88bbb9773f
commit ac24688a73
5 changed files with 56 additions and 2 deletions

View file

@ -0,0 +1,15 @@
import pytest
from didier.exceptions import NoMatch, expect
def test_expect_none_raises():
"""Test that expect() raises an error if the input entity is None"""
with pytest.raises(NoMatch):
expect(None, entity_type="", argument="")
def test_expect_not_none_returns():
"""Test that expect() returns the argument if it isn't None"""
arg = "Some input string"
assert expect(arg, entity_type="", argument="") == arg