Files
python/exercises/practice/reverse-string/reverse_string_test.py
BethanyG be794198e1 [Resistor Color Expert]: Corrected Small Typos (#3469)
* Corrected small typos around resistor bands.

* Due to failing CI, alterations to the test generator script were needed.
The generated vs submitted diff now skips the first three lines of the file
so that the generation date is not picked up and flagged as needing regeneration.

Sadly, a workaround was also needed to prevent Python difflib from noting the difference
anyways and producing an empty "false positive" diff.

All templates and test files also needed to be altered to ensure that the first three
lines of every test file will always be the autogeneration comment and date.

Hopefully, this will now stop the CI failures without creating any subtle additional bugs.

* Touch up to bowling template.  Added back the error raising utility.
* Touch up to two-bucket template to add back in error raising utility.
[no important files changed]
2023-07-21 16:54:40 -07:00

30 lines
851 B
Python

# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/reverse-string/canonical-data.json
# File last updated on 2023-07-19
import unittest
from reverse_string import (
reverse,
)
class ReverseStringTest(unittest.TestCase):
def test_an_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")
def test_an_even_sized_word(self):
self.assertEqual(reverse("drawer"), "reward")