Sha256: a8471f787a106a6e922b8b36e23b5f7b53a6093dfa32456a87b4479f2e9b9ec4

Contents?: true

Size: 753 Bytes

Versions: 52

Compression:

Stored size: 753 Bytes

Contents

import unittest

import roman_numerals


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0

class RomanTest(unittest.TestCase):
    numerals = {
        1: 'I',
        2: 'II',
        3: 'III',
        4: 'IV',
        5: 'V',
        6: 'VI',
        9: 'IX',
        27: 'XXVII',
        48: 'XLVIII',
        49: 'XLIX',
        59: 'LIX',
        93: 'XCIII',
        141: 'CXLI',
        163: 'CLXIII',
        402: 'CDII',
        575: 'DLXXV',
        911: 'CMXI',
        1024: 'MXXIV',
        3000: 'MMM',
    }

    def test_numerals(self):
        for arabic, numeral in self.numerals.items():
            self.assertEqual(roman_numerals.numeral(arabic), numeral)


if __name__ == '__main__':
    unittest.main()

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
trackler-2.2.1.160 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.159 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.158 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.157 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.156 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.155 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.154 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.153 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.152 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.151 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.150 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.149 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.148 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.147 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.146 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.145 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.144 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.143 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.142 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.141 tracks/python/exercises/roman-numerals/roman_numerals_test.py