Ejemplo n.º 1
0
 def test_from_roman_case(self):
     """from_roman should only accept uppercase input"""
     for integer in range(1, 5000):
         numeral = roman.to_roman(integer)
         roman.from_roman(numeral.upper())
         self.assertRaises(roman.InvalidRomanNumeralError,
                           roman.from_roman, numeral.lower())
Ejemplo n.º 2
0
 def test_from_roman(self):
     """from_roman should give known result with known input"""
     for integer, numeral in self.known_values:
         result = roman.from_roman(numeral)
         self.assertEqual(integer, result)
Ejemplo n.º 3
0
 def test_round_trip(self):
     """from_roman(to_roman(n))==n for all n"""
     for integer in range(1, 5000):
         numeral = roman.to_roman(integer)
         result = roman.from_roman(numeral)
         self.assertEqual(integer, result)