Ejemplo n.º 1
0
 def test_round_trip(self):
     '''should return valid roman numeral from integer, and then back to integer'''
     # for number, numeral in self.known_values:
     for integer in range(1, 4000):
         roman = roman1.to_roman(integer)
         round_trip_number = roman1.from_roman(roman)
         self.assertEqual(integer, round_trip_number)
Ejemplo n.º 2
0
    def test_from_roman_known_values(self):
        '''from_roman(to_roman(n)) == n for all n'''
        # self.assertEqual(roman1.from_roman('MMMMCMXCIX'), 4999)
        for integer in range(1, 5000):
            numeral = roman1.to_roman(integer)

            result = roman1.from_roman(numeral)
            self.assertEqual(integer, result)
Ejemplo n.º 3
0
 def test_roundtrip(self):
     '''from_roman(to_roman(n))==n fpr all n'''
     for integer in range(1, 4000):
         numeral = roman1.to_roman(integer)
         result = roman1.from_roman(numeral)
         self.assertEqual(integer, result)
Ejemplo n.º 4
0
 def test_from_roman_known_values(self):
     """from_roman should give known result with known input"""
     for integer, numeral in self.known_values:
         result = roman1.from_roman(numeral)
         self.assertEqual(integer, result)
Ejemplo n.º 5
0
 def test_roundtrip(self):
     '''from_roman(to_roman(n)==n for all n'''
     for integer in range(1, 5000):
         numeral = roman1.to_roman(integer)
         result = roman1.from_roman(numeral)
         self.assertEqual(integer, result)
Ejemplo n.º 6
0
 def test_from_roman_known_values(self):
     '''from_roman should give known result with known input'''
     for integer, numeral in self.known_values:
         result = roman1.from_roman(numeral)
         self.assertEqual(integer, result)
Ejemplo n.º 7
0
 def test_roundtrip(self):
     for integer in range(1, 4000):
         numeral = roman1.to_roman(integer)
         result = roman1.from_roman(numeral)
         self.assertEqual(integer, result)
Ejemplo n.º 8
0
 def test_to_number_known_values(self):
     '''to_nmber should return an integer based on valid roman numeral input'''
     for number, numeral in self.known_values:
         result = roman1.from_roman(numeral)
         self.assertEqual(number, result)
Ejemplo n.º 9
0
 def test_round_trip(self):
     """from_roman(to_roman(n)) should equals to n"""
     for integer in range(1,5000):
         result = roman1.from_roman(roman1.to_roman(integer))
         self.assertEqual(result,integer)
Ejemplo n.º 10
0
 def test_roundtrip(self):
     ''' from_roman(to_roman(n)) == n for n = (1...3999) '''
     for num in range(1, 4000):
         numeral = roman1.to_roman(num)
         result = roman1.from_roman(numeral)
         self.assertEqual(result, num)
Ejemplo n.º 11
0
 def test_Roundtrip(self):
     for integer in range(1, 4000):
         numeral = roman1.to_roman(integer)
         result = roman1.from_roman(numeral)
         self.assertEqual(integer, result)
Ejemplo n.º 12
0
 def test_from_roman_known_values(self):
     for integer, numeral in self.known_values:
         result = roman1.from_roman(numeral)
         self.assertEqual(integer, result)