Esempio n. 1
0
 def test_convert_to_all(self):
     self.assertEqual(
         convert_to_all(-1, 'CZK'),
         error_msg('Error', "Amount has to be a number greater than zero!"))
     self.assertEqual(
         convert_to_all(1, 5),
         error_msg(
             'Error', "Entered currency code or symbol not found! "
             "Mind the upper casing!"))
     self.assertEqual(
         convert_to_all(1, 'usd'),
         error_msg(
             'Error', "Entered currency code or symbol not found! "
             "Mind the upper casing!"))
     self.assertEqual(convert_to_all(1, '¥'), (convert_to_all(1, 'JPY')))
Esempio n. 2
0
 def test_convert_between(self):
     self.assertEqual(
         convert_to_all(-1, 'CZK'),
         error_msg('Error', "Amount has to be a number greater than zero!"))
     self.assertEqual(
         convert_between(1, 5, 'JPY'),
         error_msg(
             'Error', "Entered currency code or symbol not found! "
             "Mind the upper casing!"))
     self.assertEqual(
         convert_between(1, 'CZK', ':'),
         error_msg(
             'Error', "Entered currency code or symbol not found! "
             "Mind the upper casing!"))
     self.assertEqual(
         convert_between(1, 'usd', 'nok'),
         error_msg(
             'Error', "Entered currency code or symbol not found! "
             "Mind the upper casing!"))
     self.assertEqual(convert_between(1, 'Kč', 'Nkr'),
                      convert_between(1, 'CZK', 'NOK'))
Esempio n. 3
0
 def test_error_msg(self):
     self.assertEqual(error_msg('SomeError', "This is wrong!"),
                      json.dumps({'SomeError': "This is wrong!"}))