Exemplo n.º 1
0
def test_remove_by_value():
    collection = CoinCollection(20, 20, 10)

    removed = collection.remove_by_value(0.50)

    assert removed == [0.20, 0.20, 0.10]
Exemplo n.º 2
0
def test_creating_collection_from_value():
    assert CoinCollection.from_value(1.25) == CoinCollection(100, 20, 5)
Exemplo n.º 3
0
def test_coin_collections_are_equal():
    assert CoinCollection(1, 2) == CoinCollection(1, 2)
Exemplo n.º 4
0
def test_collection_equal_to_list():
    assert CoinCollection(1, 2, 3) == [1, 2, 3]
Exemplo n.º 5
0
def test_removing_coins_from_collection():
    collection = CoinCollection(1, 2)

    collection.remove(1)

    assert collection == CoinCollection(2)
Exemplo n.º 6
0
def test_extending_collection():
    collection = CoinCollection(1, 2)

    collection.extend([3, 4])

    assert collection == CoinCollection(1, 2, 3, 4)
Exemplo n.º 7
0
def test_appending_to_collection():
    collection = CoinCollection(1, 2)

    collection.append(3)

    assert collection == CoinCollection(1, 2, 3)