Пример #1
0
 def testFromRomanCase(self):
     """fromRoman should only accept uppercase input"""
     for integer in range(1, 4000):
         numeral = roman6.toRoman(integer)
         roman6.fromRoman(numeral.upper())
         self.assertRaises(roman6.InvalidRomanNumeralError,
                           roman6.fromRoman, numeral.lower())
Пример #2
0
 def testFromRomanKnownValues(self):
     """fromRoman should give known result with known input"""
     for integer, numeral in self.knownValues:
         result = roman6.fromRoman(numeral)
         self.assertEqual(integer, result)
Пример #3
0
 def testSanity(self):
     """fromRoman(toRoman(n))==n for all n"""
     for integer in range(1, 4000):
         numeral = roman6.toRoman(integer)
         result = roman6.fromRoman(numeral)
         self.assertEqual(integer, result)