def test_coin_amount_fail(): coin = Coin(amount=-5000, denom="uband") with pytest.raises(NegativeIntegerError, match="Expect amount more than 0"): coin.validate()
def test_coin_success(): coin = Coin(amount=5000, denom="uband") assert coin.as_json() == {"amount": "5000", "denom": "uband"} assert coin.validate() == True