Ejemplo n.º 1
0
 def test_no_decimal(self):
     text = 'S$ 10' * 2
     with self.assertRaises(AssertionError):
         get_balance_from_text(text)
Ejemplo n.º 2
0
 def test_return_type(self):
     text = 'S$ 0.00' * 2
     result = get_balance_from_text(text)
     self.assertEqual(type(result), float)
Ejemplo n.º 3
0
 def test_one_match(self):
     text = 'S$ 0.00'
     with self.assertRaises(AssertionError):
         get_balance_from_text(text)
Ejemplo n.º 4
0
 def test_empty_string(self):
     text = ''
     with self.assertRaises(AssertionError):
         get_balance_from_text(text)
Ejemplo n.º 5
0
 def test_less_than_billion(self):
     text = 'S$ 999,999,999.99' * 2
     self.assertEqual(get_balance_from_text(text), 999_999_999.99)
Ejemplo n.º 6
0
 def test_less_than_thousand(self):
     text = 'S$ 999.999' * 2
     self.assertEqual(get_balance_from_text(text), 999.99)
Ejemplo n.º 7
0
 def test_zero(self):
     text = 'S$ 0.00' * 2
     self.assertEqual(get_balance_from_text(text), 0)