Fix exception tests

This commit is contained in:
Daniel Carrillo 2024-06-08 15:53:50 +02:00
parent a90dbd0123
commit df1d08312f
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ def test_lookup(test_dig):
with pytest.raises(ValueError) as e:
test_dig.lookup("what are you talking about")
assert e.startswith("Wrong IP or CIDR format")
assert str(e.value).startswith("Wrong IP or CIDR format")
def test_response_plain_print(test_dig, capsys):

View File

@ -83,4 +83,4 @@ def test_get_aws_ip_ranges_invalid_status(mocker, fs, create_cache_dir) -> None:
with pytest.raises(digaws.UnexpectedRequestException) as e:
digaws.get_aws_ip_ranges()
assert e.match("^Unexpected response from")
assert str(e.value).startswith("Unexpected response from")