示例#1
0
 def test_to_roman_known_values(self):
     '''to_roman should give known result with known input'''
     for integer, numeral in self.known_values:
         result = roman2.to_roman(integer)
         self.assertEqual(numeral, result)
示例#2
0
 def test_to_roman_known_values(self):
     '''to_roman should give known result with known input'''
     for integer, numeral in self.known_values:
         result = roman2.to_roman(integer)
         self.assertEqual(numeral, result)
示例#3
0
 def test_roundtrip(self):
     '''from_roman(to_roman(n)) == n for all n'''
     for n in range(1, 5000):
         s = roman2.to_roman(n)
         self.assertEqual(n, roman2.from_roman(s))
 def test_to_roman_known_values(self):
     '''to_roman dovrebbe dare un risultato noto con un ingresso noto'''
     for integer, numeral in self.known_values:
         result = roman2.to_roman(integer)
         self.assertEqual(numeral, result)
示例#5
0
 def test_roundtrip(self):
     '''from_roman(to_roman(n))==n fpr all n'''
     for integer in range(1, 4000):
         numeral = roman2.to_roman(integer)
         result = roman2.from_roman(numeral)
         self.assertEqual(integer, result)
示例#6
0
 def test_roundtrip(self):
     '''from_roman(to_roman(n))==n for all n'''
     for integer in range(1, 5000):
         numeral = roman2.to_roman(integer)
         result = roman2.from_roman(numeral)
         self.assertEqual(integer, result)
示例#7
0
 def test_round_trip(self):
     '''Test all allowable input for to/from_roman is equal'''
     for integer in range(1, 4999):
         numeral = roman2.to_roman(integer)
         result = roman2.from_roman(numeral)
         self.assertEqual(integer, result)