-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherrors_test.py
31 lines (23 loc) · 1.03 KB
/
errors_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""errors.py unit tests."""
from pypyr.errors import Error as PypyrError
from pypyr.errors import PlugInError
from pypyraws.errors import Error as PypyrAwsError
from pypyraws.errors import WaitTimeOut
import pytest
def test_base_error_raises():
"""Pypyr root Error raises with correct message."""
with pytest.raises(PypyrAwsError) as err_info:
raise PypyrAwsError("this is error text right here")
assert str(err_info.value) == "this is error text right here"
def test_wait_timeout_raises():
"""Aws WaitTimeOut error raises with correct message."""
with pytest.raises(WaitTimeOut) as err_info:
raise WaitTimeOut("this is error text right here")
assert str(err_info.value) == "this is error text right here"
def test_wait_timeout_inheritance():
"""The WaitTimeOut should inherit all the way up to pypyr Error."""
# confirm subclassed from pypyr root error
err = WaitTimeOut()
assert isinstance(err, PypyrAwsError)
assert isinstance(err, PlugInError)
assert isinstance(err, PypyrError)