From 759acb019f15a6df3c26e2e5fb527f21f8d63921 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sat, 14 Dec 2024 01:41:47 -0800 Subject: [PATCH] Update test_generate_hashtag.py --- .../test_generate_hashtag.py | 73 +++++++++---------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/kyu_5/the_hashtag_generator/test_generate_hashtag.py b/kyu_5/the_hashtag_generator/test_generate_hashtag.py index 62ee385b52b..958a9594c14 100644 --- a/kyu_5/the_hashtag_generator/test_generate_hashtag.py +++ b/kyu_5/the_hashtag_generator/test_generate_hashtag.py @@ -33,40 +33,39 @@ class GenerateHashtagTestCase(unittest.TestCase): @parameterized.expand( [('', - False, - 'Expected an empty string to return False'), - ('Codewars', - '#Codewars', - 'Should handle a single word.'), - ('Codewars ', - '#Codewars', - 'Should handle trailing whitespace.'), - ('Codewars Is Nice', - '#CodewarsIsNice', - 'Should remove spaces.'), - ('codewars is nice', - '#CodewarsIsNice', - 'Should capitalize first letters of words.'), - ('CodeWars is nice', - '#CodewarsIsNice', - 'Should capitalize all letters of words - ' - 'all lower case but the first.'), - ('c i n', - '#CIN', - 'Should capitalize first letters of words even ' - 'when single letters.'), - ('codewars is nice', - '#CodewarsIsNice', - 'Should deal with unnecessary middle spaces.'), - ('Loooooooooooooooooooooooooooooooooooo' - 'oooooooooooooooooooooooooooooooooooooo' - 'oooooooooooooooooooooooooooooooooooooo' - 'ooooooooooooooooooooooooooooooooooooo' - 'oooooong Cat', - False, - 'Should return False if the final word is ' - 'longer than 140 chars.')] - ) + False, + 'Expected an empty string to return False'), + ('Codewars', + '#Codewars', + 'Should handle a single word.'), + ('Codewars ', + '#Codewars', + 'Should handle trailing whitespace.'), + ('Codewars Is Nice', + '#CodewarsIsNice', + 'Should remove spaces.'), + ('codewars is nice', + '#CodewarsIsNice', + 'Should capitalize first letters of words.'), + ('CodeWars is nice', + '#CodewarsIsNice', + 'Should capitalize all letters of words - ' + 'all lower case but the first.'), + ('c i n', + '#CIN', + 'Should capitalize first letters of words even ' + 'when single letters.'), + ('codewars is nice', + '#CodewarsIsNice', + 'Should deal with unnecessary middle spaces.'), + ('Loooooooooooooooooooooooooooooooooooo' + 'oooooooooooooooooooooooooooooooooooooo' + 'oooooooooooooooooooooooooooooooooooooo' + 'ooooooooooooooooooooooooooooooooooooo' + 'oooooong Cat', + False, + 'Should return False if the final word is ' + 'longer than 140 chars.')]) def test_generate_hashtag(self, string, expected, message): """ Testing 'generate_hashtag' function with various test data. @@ -95,7 +94,7 @@ def test_generate_hashtag(self, string, expected, message): with allure.step("Enter a test string and verify the output:"): actual_result = generate_hashtag(string) print_log(string=string, - message=message, - expected=expected, - actual_result=actual_result) + message=message, + expected=expected, + actual_result=actual_result) self.assertEqual(expected, actual_result, message)