def test_sort_cash(self): result = { 100: 0, 50: 0, 20: 0, 10: 1, 5: 0, 2: 1, 1: 0, 0.25: 1, 0.1: 0, 0.05: 1, 0.01: 4 } self.assertEqual(sort_cash(12.34), result)
def test_sort_negative_integer(self): with self.assertRaises(ValueError): sort_cash(-1)
def test_sort_positive_integer(self): with self.assertRaises(ValueError): sort_cash(1)
def test_sort_zero(self): with self.assertRaises(ValueError): sort_cash(0)
def test_sort_zero_float_(self): with self.assertRaises(ValueError): sort_cash(0.00)
def test_sort_negative_float_money(self): with self.assertRaises(ValueError): sort_cash(-1.00)