diff --git a/tests/functional/test_exceptions.py b/tests/functional/test_exceptions.py index cda512b95f..5013b2fef6 100644 --- a/tests/functional/test_exceptions.py +++ b/tests/functional/test_exceptions.py @@ -12,6 +12,7 @@ ContractNotFoundError, NetworkNotFoundError, TransactionError, + UnknownSnapshotError, handle_ape_exception, ) from ape.types import SourceTraceback @@ -247,3 +248,15 @@ def test_fork_network(self): "Try installing an explorer plugin using \x1b[32mape plugins install etherscan" "\x1b[0m, or using a network with explorer support." ) + + +class TestUnknownSnapshotError: + def test_bytes(self): + snapshot_id = b"asdfasdfasdf" + err = UnknownSnapshotError(snapshot_id) + assert str(err) == "Unknown snapshot ID '6173..6466'." + + @pytest.mark.parametrize("snapshot_id", (123, "123")) + def test_not_bytes(self, snapshot_id): + err = UnknownSnapshotError(snapshot_id) + assert str(err) == "Unknown snapshot ID '123'."