mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 23:55:46 +02:00
Increase coverage a bit
This commit is contained in:
parent
88bbb9773f
commit
ac24688a73
5 changed files with 56 additions and 2 deletions
0
tests/test_didier/test_exceptions/__init__.py
Normal file
0
tests/test_didier/test_exceptions/__init__.py
Normal file
15
tests/test_didier/test_exceptions/test_no_match.py
Normal file
15
tests/test_didier/test_exceptions/test_no_match.py
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue