コード例 #1
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())
コード例 #2
0
ファイル: romantest4.py プロジェクト: JASON9620/python
 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())
コード例 #3
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)
コード例 #4
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)
コード例 #5
0
ファイル: romantest4.py プロジェクト: JASON9620/python
 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
ファイル: romantest4.py プロジェクト: JASON9620/python
 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)