def test_check_coins_in_with_invalid_coins(self): with self.assertRaises(AssertionError): count_coins_in([1, 3, 10, 20])
def test_check_coins_in_with_valid_coins(self): self.assertEqual(count_coins_in([1, 1, 10, 10, 20]), 42)
def test_check_coins_in_with_invalid_coins(): with pytest.raises(AssertionError): count_coins_in([1, 3, 10, 20])
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_check_coins_in_with_valid_coins(): assert count_coins_in([1, 1, 10, 10, 20]) == 42