def test_5_as_roman(self): self.assertEqual('V', decimal_to_roman(5))
from romannumerals import decimal_to_roman if __name__ == '__main__': print(__name__) inputNumber = int(input("Please enter a number > 0 to convert to a roman numeral: ")) print(decimal_to_roman(inputNumber, True))
def test_444_as_roman_compressed(self): expected_result = 'CDXLIV' actual_result = decimal_to_roman(444, True) self.assertEqual(expected_result, actual_result)
def test_1_as_roman(self): self.assertEqual('I', decimal_to_roman(1))
def test_2999_as_roman(self): expected_result = 'MMDCCCCLXXXXVIIII' actual_result = decimal_to_roman(2999) self.assertEqual(expected_result, actual_result)
def test_2999_as_roman_compressed(self): expected_result = 'MMCMXCVIV' actual_result = decimal_to_roman(2999, True) self.assertEqual(expected_result, actual_result)
def test_1984_as_roman(self): expected_result = 'MDCCCCLXXXIIII' actual_result = decimal_to_roman(1984) self.assertEqual(expected_result, actual_result)
def test_42_as_roman(self): expected_result = 'XXXXII' actual_result = decimal_to_roman(42) self.assertEqual(expected_result, actual_result)
def test_2_as_roman(self): self.assertEqual('II', decimal_to_roman(2))
def test_1000_as_roman(self): self.assertEqual('M', decimal_to_roman(1000))
def test_500_as_roman(self): self.assertEqual('D', decimal_to_roman(500))