def test_compute_change_coins_change(self):
     coinsback = compute_change_coins(99)
     self.assertDictEqual(coinsback, {1: 9, 10: 1, 20: 4})
 def test_compute_change_coins_no_change(self):
     coinsback = compute_change_coins(0)
     self.assertDictEqual(coinsback, {1: 0, 10: 0, 20: 0})
def test_compute_change_coins_change():
    coinsback = compute_change_coins(99)
    assert sorted(coinsback.items()) == [(1, 9), (10, 1), (20, 4)]
Example #4
0
 def test_correctness_of_change(self):
     money_in = count_coins_in(self.coins_in)
     change = compute_total_change(money_in, self.purchase)
     coins_out = compute_change_coins(change)
     self.assertDictEqual(coins_out, self.expected_change)
def test_compute_change_coins_no_change():
    coinsback = compute_change_coins(0)
    assert sorted(coinsback.items()) == [(1, 0), (10, 0), (20, 0)]