Sha256: bb3a2c96b034dc41d77cced37837bda3c55eeea8a9e90b330855bc1e0debd91b

Contents?: true

Size: 696 Bytes

Versions: 19

Compression:

Stored size: 696 Bytes

Contents

import unittest

from reverse_string import reverse


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

class ReverseStringTest(unittest.TestCase):
    def test_empty_string(self):
            self.assertEqual(reverse(''), '')

    def test_a_word(self):
            self.assertEqual(reverse('robot'), 'tobor')

    def test_a_capitalized_word(self):
            self.assertEqual(reverse('Ramen'), 'nemaR')

    def test_a_sentence_with_punctuation(self):
            self.assertEqual(reverse('I\'m hungry!'), '!yrgnuh m\'I')

    def test_a_palindrome(self):
            self.assertEqual(reverse('racecar'), 'racecar')


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

Version data entries

19 entries across 19 versions & 1 rubygems

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