def test_invalid_data(self): in_string = "A6" with self.assertRaises(InvalidDataException): out_string = improve_dollar_amount(in_string) print out_string
def test_remove_chars(self): in_string = "$1,234.56" out_string = improve_dollar_amount(in_string) self.assertEqual("1234.56", out_string)
def test_add_cents(self): in_string = "123" out_string = improve_dollar_amount(in_string) self.assertEqual("123.00", out_string)
def test_no_op(self): in_string = "1234.56" out_string = improve_dollar_amount(in_string) self.assertEqual(in_string, out_string)