example of catching exception with pytzeos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_increaseCounterBy_negative_value_should_throw_exception(self): | |
try: | |
# Given | |
increase_value = -1 | |
# When | |
self.contract.increaseCounterBy(increase_value).result(storage=0) | |
except MichelsonRuntimeError as e: | |
# Then | |
return self.assertTrue("value should be > 0" in str(e)) | |
self.fail("This fail should not happen.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment