Skip to content

Commit

Permalink
test: ensure err works
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Sep 11, 2024
1 parent c1efd86 commit 54c04c3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/functional/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ContractNotFoundError,
NetworkNotFoundError,
TransactionError,
UnknownSnapshotError,
handle_ape_exception,
)
from ape.types import SourceTraceback
Expand Down Expand Up @@ -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'."

0 comments on commit 54c04c3

Please sign in to comment.