示例#1
0
 def test_convert_MMMCMXCIX(self):
     number = roman_to_int("MMMCMXCIX")
     self.assertEqual(number, 3999)
示例#2
0
 def test_convert_MCMXLIV(self):
     # got this one from wiki. should be able subtract larger ones..
     number = roman_to_int("MCMXLIV")
     self.assertEqual(number, 1944)
示例#3
0
 def test_convert_CM(self):
     number = roman_to_int("CM")
     self.assertEqual(number, 900)
示例#4
0
 def test_convert_MI(self):
     number = roman_to_int("MI")
     self.assertEqual(number, 1001)
示例#5
0
 def test_convert_CD(self):
     number = roman_to_int("CD")
     self.assertEqual(number, 400)
示例#6
0
 def test_convert_D(self):
     number = roman_to_int("D")
     self.assertEqual(number, 500)
示例#7
0
 def test_convert_XC(self):
     number = roman_to_int("XC")
     self.assertEqual(number, 90)
示例#8
0
 def test_convert_C(self):
     number = roman_to_int("C")
     self.assertEqual(number, 100)
示例#9
0
 def test_convert_L(self):
     number = roman_to_int("L")
     self.assertEqual(number, 50)
示例#10
0
 def test_convert_XL(self):
     number = roman_to_int("XL")
     self.assertEqual(number, 40)
示例#11
0
 def test_convert_X(self):
     number = roman_to_int("X")
     self.assertEqual(number, 10)
示例#12
0
 def test_convert_IX(self):
     number = roman_to_int("IX")
     self.assertEqual(number, 9)
示例#13
0
 def test_convert_V(self):
     number = roman_to_int("V")
     self.assertEqual(number, 5)