示例#1
0
 def test_decades(self):
     self.assertEqual('XLV', to_roman(45))
示例#2
0
    def test_non_valid_input(self):
        with self.assertRaises(NonValidInput):
            to_roman(0)

        with self.assertRaises(NonValidInput):
            to_roman(5001)
示例#3
0
 def test_simple_number(self):
     self.assertEqual('III', to_roman(3))
示例#4
0
 def test_edge_cases(self):
     self.assertEqual('I', to_roman(1))
     self.assertEqual('\u2181', to_roman(5000))
示例#5
0
 def test_ending_zero(self):
     self.assertEqual('CC', to_roman(200))
示例#6
0
 def test_middle_zero(self):
     self.assertEqual('CDIV', to_roman(404))
示例#7
0
 def test_thousands(self):
     self.assertEqual('MMMDXXI', to_roman(3521))
示例#8
0
 def test_hundreds(self):
     self.assertEqual('DCXXXIV', to_roman(634))