Exemple #1
0
from src.utils.roman import Roman

while True:
    try:
        print('    Insira um número entre 1 e 3000\n')
        number = input('>>> \n')

        if Roman.convert_digits(number=number):
            print(Roman.convert_digits(number=number))

        else:
            print('    Número inválido!\n')

    except KeyboardInterrupt:
        exit(0)
Exemple #2
0
 def test_equal_1(self):
     self.assertEqual(Roman.convert_digits('1'), 'I')
Exemple #3
0
 def test_equal_2(self):
     self.assertEqual(Roman.convert_digits('200'), 'CC')
Exemple #4
0
 def test_false_3(self):
     self.assertFalse(Roman.convert_digits('ABC'))
Exemple #5
0
 def test_false_2(self):
     self.assertFalse(Roman.convert_digits('3001'))
Exemple #6
0
 def test_false_1(self):
     self.assertFalse(Roman.convert_digits('0'))
Exemple #7
0
 def test_equal_4(self):
     self.assertEqual(Roman.convert_digits('2998'), 'MMCMXCVIII')
Exemple #8
0
 def test_equal_3(self):
     self.assertEqual(Roman.convert_digits('1700'), 'MDCC')