Skip to content

Commit

Permalink
Update test_pig_it.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostan committed Dec 14, 2024
1 parent 29c5bd3 commit fd42b67
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions kyu_5/simple_pig_latin/test_pig_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import unittest
import allure
from parameterized import parameterized
from utils.log_func import print_log
from kyu_5.simple_pig_latin.pig_it import pig_it

Expand All @@ -28,7 +29,12 @@
class PigItTestCase(unittest.TestCase):
"""Testing pig_it function."""

def test_pig_it(self):
@parameterized.expand([
('Pig latin is cool', 'igPay atinlay siay oolcay'),
('This is my string', 'hisTay siay ymay tringsay'),
('Hello world !', 'elloHay orldway !'),
("O tempora o mores !", 'Oay emporatay oay oresmay !')])
def test_pig_it(self, text, expected):
"""
Testing pig_it function.
Expand All @@ -47,13 +53,7 @@ def test_pig_it(self):
'<h3>Test Description:</h3>'
"<p></p>")
# pylint: enable-msg=R0801
with allure.step("Enter test string and verify the output"):
test_data: tuple = (
('Pig latin is cool', 'igPay atinlay siay oolcay'),
('This is my string', 'hisTay siay ymay tringsay'),
('Hello world !', 'elloHay orldway !'),
("O tempora o mores !", 'Oay emporatay oay oresmay !'))

for text, expected in test_data:
print_log(expected=expected, text=text)
self.assertEqual(expected, pig_it(text))
with allure.step(f"Enter test string: {text} "
f"and verify the output: {expected}"):
print_log(expected=expected, text=text)
self.assertEqual(expected, pig_it(text))

0 comments on commit fd42b67

Please sign in to comment.