Example #1
0
 def test_check_all_digits(self):
     """
     Auto check of all converting
     """
     for i in six.moves.range(1, 4000):
         roman_number = roman.encode(i)
         self.assertEqual(roman.decode(roman_number), i)
Example #2
0
 def test_check_valid_roman_number(self):
     """
     Check is_valid functions for valid roman numbers
     """
     for i in six.moves.range(1, 4000):
         roman_number = roman.encode(i)
         self.assertTrue(roman.is_valid(roman_number))
Example #3
0
 def test_wrong_type_of_number(self, _, number):
     """
     Check wrong type of passed argument
     """
     with self.assertRaises(exceptions.WrongArgumentTypeError):
         roman.encode(number)
Example #4
0
 def test_out_of_range_roman_numbers(self, _, number):
     """
     Check wrong number converting
     """
     with self.assertRaises(exceptions.NumberOutOfRangeError):
         roman.encode(number)
Example #5
0
 def test_check_base_numbers_to_roman(self, expected, number):
     """
     Manual check if converting is correction
     """
     result = roman.encode(number)
     self.assertEqual(result, expected)