示例#1
0
 def test_roman_decimal_roman_one(self):
     resultado = roman(1)
     self.assertEqual(resultado, 'I')
示例#2
0
 def test_roman_decimal_3999(self):
     resultado = roman(3999)
     self.assertEqual(resultado, 'MMMCMXCIX')
示例#3
0
 def test_roman_decimal_4000(self):
     resultado = roman(4000)
     self.assertEqual(resultado, 'Not a valid number')
示例#4
0
 def test_roman_decimal_roman_minor(self):
     resultado = roman(-1)
     self.assertEqual(resultado, "Can't convert to roman number!")
示例#5
0
 def test_roman_decimal_roman_not_type(self):
     resultado = roman(10.5)
     self.assertEqual(resultado, "Only int numbers")
示例#6
0
 def test_roman_decimal_roman_five(self):
     resultado = roman(5)
     self.assertEqual(resultado, 'V')
示例#7
0
 def test_roman_decimal_roman_845(self):
     resultado = roman(845)
     self.assertEqual(resultado, 'DCCCXLV')
示例#8
0
 def test_roman_decimal_roman_ten(self):
     resultado = roman(10)
     self.assertEqual(resultado, 'X')
示例#9
0
 def test_roman_decimal_roman_four(self):
     resultado = roman(4)
     self.assertEqual(resultado, 'IV')
示例#10
0
 def test_roman_decimal_roman_two(self):
     resultado = roman(2)
     self.assertEqual(resultado, 'II')
示例#11
0
def roman_to_roman(romano):
    return roman(decimal(romano))
示例#12
0
 def test_all(self):
     for number in xrange(1, 4):
         roman_result = roman(number)
         result = decimal(roman_result)
         self.assertEqual(number, result)