Beispiel #1
0
 def __init__(self, cost_in_euro, payer, participants):
     self.cost_in_cents = utils.parse_amount(cost_in_euro)
     self.payer = payer
     self.participants = participants
     self.balancing_operation = False
     self.date = time.localtime()
     self.remainder_person = ""
Beispiel #2
0
    def test_error_comma(self):
        with self.assertRaises(u.ConversionError):
            u.parse_amount("3,troll")

        with self.assertRaises(u.ConversionError):
            u.parse_amount("3,tr")

        with self.assertRaises(u.ConversionError):
            u.parse_amount("3,333")
Beispiel #3
0
    def test_error_dot(self):
        with self.assertRaises(u.ConversionError):
            u.parse_amount("3.troll")

        with self.assertRaises(u.ConversionError):
            u.parse_amount("3.tr")

        with self.assertRaises(u.ConversionError):
            u.parse_amount("3.333")
Beispiel #4
0
 def test_simple_dot(self):
     self.assertEqual(u.parse_amount("3.6"), 360)
     self.assertEqual(u.parse_amount("3.60"), 360)
     self.assertEqual(u.parse_amount("3."), 300)
Beispiel #5
0
 def test_error(self):
     with self.assertRaises(u.ConversionError):
         u.parse_amount("troll")
Beispiel #6
0
 def test_without_delim(self):
     self.assertEqual(u.parse_amount("3"), 300)
Beispiel #7
0
 def test_simple_comma(self):
     self.assertEqual(u.parse_amount("3,6"), 360)
     self.assertEqual(u.parse_amount("3,60"), 360)
     self.assertEqual(u.parse_amount("3,"), 300)
Beispiel #8
0
 def __init__(self, amount_in_euro, source, destination):
   self.amount_in_cents = utils.parse_amount(amount_in_euro)
   self.source = source
   self.destination = destination
   self.date = time.localtime()