예제 #1
0
 def test_from_roman_known_values(self):
     '''from_roman should give known result with known input'''
     for integer, numeral in self.known_values:
         result = from_roman(numeral)
         self.assertEqual(integer, result)
예제 #2
0
 def test_roundtrip(self):
     """from_roman(to_roman(n))==n for all n"""
     for integer in range(1, 5000):
         numeral = to_roman(integer)
         result = from_roman(numeral)
         self.assertEqual(integer, result)