예제 #1
0
def test_coin_amount_fail():
    coin = Coin(amount=-5000, denom="uband")

    with pytest.raises(NegativeIntegerError,
                       match="Expect amount more than 0"):
        coin.validate()
예제 #2
0
def test_coin_success():
    coin = Coin(amount=5000, denom="uband")

    assert coin.as_json() == {"amount": "5000", "denom": "uband"}

    assert coin.validate() == True