Sha256: c5bd296da8286a5397eebfe5f626343b389f76bb88f2625db9bcb245f36441c7

Contents?: true

Size: 733 Bytes

Versions: 62

Compression:

Stored size: 733 Bytes

Contents

import unittest

import roman_numerals


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

class RomanTest(unittest.TestCase):
    numerals = {
        1: 'I',
        2: 'II',
        3: 'III',
        4: 'IV',
        5: 'V',
        6: 'VI',
        9: 'IX',
        27: 'XXVII',
        48: 'XLVIII',
        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

62 entries across 62 versions & 1 rubygems

Version Path
trackler-2.2.1.107 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.106 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.105 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.104 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.103 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.102 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.101 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.100 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.99 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.98 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.97 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.96 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.95 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.94 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.93 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.92 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.91 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.90 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.89 tracks/python/exercises/roman-numerals/roman_numerals_test.py
trackler-2.2.1.88 tracks/python/exercises/roman-numerals/roman_numerals_test.py