Sha256: a6aab243ef9bead3aa903e148c372cec2f293b4520c150ef8f1d571a21bcf489

Contents?: true

Size: 780 Bytes

Versions: 73

Compression:

Stored size: 780 Bytes

Contents

import unittest

from acronym import abbreviate


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

class AcronymTest(unittest.TestCase):
    def test_basic(self):
        self.assertEqual(abbreviate('Portable Network Graphics'), 'PNG')

    def test_lowercase_words(self):
        self.assertEqual(abbreviate('Ruby on Rails'), 'ROR')

    def test_punctuation(self):
        self.assertEqual(abbreviate('First In, First Out'), 'FIFO')

    def test_all_caps_words(self):
        self.assertEqual(abbreviate('GNU Image Manipulation Program'), 'GIMP')

    def test_punctuation_without_whitespace(self):
        self.assertEqual(
            abbreviate('Complementary metal-oxide semiconductor'), 'CMOS')


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

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.179 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.178 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.177 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.176 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.175 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.174 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.173 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.172 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.171 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.170 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.169 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.167 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.166 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.165 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.164 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.163 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.162 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.161 tracks/python/exercises/acronym/acronym_test.py
trackler-2.2.1.160 tracks/python/exercises/acronym/acronym_test.py