* Corrected the macro for comments on the test file. * Added current_date (utcnow()) variable available for template macros. * Removed unnecessary datetime import from macros file. * Regenerated all practice exercise test files to add timestamp. * Changed `datetime.now(tz=timezone.utc)` to `datetime.now(tz=timezone.utc).date()` * Second regeneration to remove `timestamp` and just keep `date` for test files. [no important files changed]
30 lines
851 B
Python
30 lines
851 B
Python
import unittest
|
|
|
|
from reverse_string import (
|
|
reverse,
|
|
)
|
|
|
|
# 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-14
|
|
|
|
|
|
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")
|