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