def testFromRomanCase(self):
     """fromRoman should only accept uppercase input"""
     for integer in range(1, 5000):
         numeral = roman83.toRoman(integer)
         roman83.fromRoman(numeral.upper())
         self.assertRaises(roman83.InvalidRomanNumeralError,
                           roman83.fromRoman, numeral.lower())
Exemple #2
0
 def testFromRomanCase(self):
     """fromRoman should only accept uppercase input"""
     for integer in range(1, 5000):
         numeral = roman83.toRoman(integer)
         roman83.fromRoman(numeral.upper())
         self.assertRaises(roman83.InvalidRomanNumeralError,
                           roman83.fromRoman, numeral.lower())
 def testFromRomanKnownValues(self):
     """fromRoman should give known result with known input"""
     for integer, numeral in self.knownValues:
         result = roman83.fromRoman(numeral)
         self.assertEqual(integer, result)
 def testSanity(self):
     """fromRoman(toRoman(n))==n for all n"""
     for integer in range(1, 5000):
         numeral = roman83.toRoman(integer)
         result = roman83.fromRoman(numeral)
         self.assertEqual(integer, result)
Exemple #5
0
 def testFromRomanKnownValues(self):
     """fromRoman should give known result with known input"""
     for integer, numeral in self.knownValues:
         result = roman83.fromRoman(numeral)
         self.assertEqual(integer, result)
Exemple #6
0
 def testSanity(self):
     """fromRoman(toRoman(n))==n for all n"""
     for integer in range(1, 5000):
         numeral = roman83.toRoman(integer)
         result = roman83.fromRoman(numeral)
         self.assertEqual(integer, result)