コード例 #1
0
def test_from_str_parse_dec_coin():
    coin1 = Coin("uluna", 1001.5)
    coin2 = Coin.from_str("1001.500000000000000000uluna")
    assert coin1 == coin2

    coin3 = Coin("uluna", "-1.0")
    coin2 = Coin.from_str("-1.000000000000000000uluna")
コード例 #2
0
def test_from_str_parse_int_coin():
    coin1 = Coin("uluna", 1001)
    coin2 = Coin.from_str("1001uluna")
    assert coin1 == coin2

    coin3 = Coin("uluna", -1)
    coin4 = Coin.from_str("-1uluna")
    assert coin3 == coin4