def testFromRomanCase(self):
     """fromRoman should only accept uppercase input"""
     for integer in range(1, 4000):
         numeral = roman4.toRoman(integer)
         roman4.fromRoman(numeral.upper())
         self.assertRaises(roman4.InvalidRomanNumeralError,
                           roman4.fromRoman, numeral.lower())
예제 #2
0
 def testFromRomanCase(self):
     """fromRoman should only accept uppercase input"""
     for integer in range(1, 4000):
         numeral = roman4.toRoman(integer)
         roman4.fromRoman(numeral.upper())
         self.assertRaises(roman4.InvalidRomanNumeralError,
                           roman4.fromRoman, numeral.lower())
 def testFromRomanKnownValues(self):
     """fromRoman should give known result with known input"""
     for integer, numeral in self.knownValues:
         result = roman4.fromRoman(numeral)
         self.assertEqual(integer, result)
 def testSanity(self):
     """fromRoman(toRoman(n))==n for all n"""
     for integer in range(1, 4000):
         numeral = roman4.toRoman(integer)
         result = roman4.fromRoman(numeral)
         self.assertEqual(integer, result)
예제 #5
0
 def testFromRomanKnownValues(self):
     """fromRoman should give known result with known input"""
     for integer, numeral in self.knownValues:
         result = roman4.fromRoman(numeral)
         self.assertEqual(integer, result)
예제 #6
0
 def testSanity(self):
     """fromRoman(toRoman(n))==n for all n"""
     for integer in range(1, 4000):
         numeral = roman4.toRoman(integer)
         result = roman4.fromRoman(numeral)
         self.assertEqual(integer, result)
예제 #7
0
파일: romantest.py 프로젝트: Sirawap/Lab12
 def testFromRomanKnownValues(self):
     for integer, numeral in self.knowValues:
         result = roman.fromRoman(numeral)
         self.assertEqual(integer, result)