Sha256: 55c3f4f1ddd9af20ef96f8bbb7dc804d4b9b966c712db99e8a55d6c64f7be8ea

Contents?: true

Size: 986 Bytes

Versions: 47

Compression:

Stored size: 986 Bytes

Contents

import unittest

from acronym import abbreviate


# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.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_camelcase(self):
        self.assertEqual(abbreviate('HyperText Markup Language'), 'HTML')

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

    def test_all_caps_words(self):
        self.assertEqual(abbreviate('PHP: Hypertext Preprocessor'), 'PHP')

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

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


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

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
trackler-2.1.0.18 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.17 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.16 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.15 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.14 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.13 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.12 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.11 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.10 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.9 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.8 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.7 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.6 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.5 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.4 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.3 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.2 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.1 tracks/python/exercises/acronym/acronym_test.py
trackler-2.1.0.0 tracks/python/exercises/acronym/acronym_test.py
trackler-2.0.8.55 tracks/python/exercises/acronym/acronym_test.py