Esempio n. 1
0
 def testFromRomanCase(self):
     """fromRoman should only accept uppercase input"""
     for integer in range(1, 4000):
         numeral = roman5.toRoman(integer)
         roman5.fromRoman(numeral.upper())
         self.assertRaises(roman5.InvalidRomanNumeralError,
                           roman5.fromRoman, numeral.lower())
 def testFromRomanCase(self):
     """fromRoman should only accept uppercase input"""
     for integer in range(1, 4000):
         numeral = roman5.toRoman(integer)
         roman5.fromRoman(numeral.upper())
         self.assertRaises(roman5.InvalidRomanNumeralError,
                           roman5.fromRoman, numeral.lower())
 def testToRomanKnownValues(self):
     """toRoman should give known result with known input"""
     for integer, numeral in self.knownValues:
         result = roman5.toRoman(integer)
         self.assertEqual(numeral, result)
 def testToRomanCase(self):
     """toRoman should always return uppercase"""
     for integer in range(1, 4000):
         numeral = roman5.toRoman(integer)
         self.assertEqual(numeral, numeral.upper())
 def testSanity(self):
     """fromRoman(toRoman(n))==n for all n"""
     for integer in range(1, 4000):
         numeral = roman5.toRoman(integer)
         result = roman5.fromRoman(numeral)
         self.assertEqual(integer, result)
Esempio n. 6
0
 def testSanity(self):
     """fromRoman(toRoman(n))==n for all n"""
     for integer in range(1, 4000):
         numeral = roman5.toRoman(integer)
         result = roman5.fromRoman(numeral)
         self.assertEqual(integer, result)
Esempio n. 7
0
 def testToRomanKnownValues(self):
     """toRoman should give known result with known input"""
     for integer, numeral in self.knownValues:
         result = roman5.toRoman(integer)
         self.assertEqual(numeral, result)
Esempio n. 8
0
 def testToRomanCase(self):
     """toRoman should always return uppercase"""
     for integer in range(1, 4000):
         numeral = roman5.toRoman(integer)
         self.assertEqual(numeral, numeral.upper())