From f1d31ca43e92863ec6efd74a695a7d32f718c793 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:27:55 -0800 Subject: [PATCH] Update test_third_angle_of_triangle.py --- .../test_third_angle_of_triangle.py | 32 ++++--------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py b/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py index 39f3e1622cd..7066b65393e 100644 --- a/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py +++ b/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py @@ -9,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.third_angle_of_triangle.third_angle_of_triangle \ import other_angle @@ -29,7 +30,12 @@ class OtherAngleTestCase(unittest.TestCase): """Testing other_angle function.""" - def test_other_angle(self): + @parameterized.expand([ + (30, 60, 90), + (60, 60, 60), + (43, 78, 59), + (10, 20, 150)]) + def test_other_angle(self, a, b, expected): """ Testing other_angle function with various test data. @@ -47,29 +53,5 @@ def test_other_angle(self): "Find the 3rd.

") # pylint: enable-msg=R0801 with allure.step("Enter values of two angles and return the 3rd"): - a: int = 30 - b: int = 60 - expected: int = 90 - print_log(a=a, b=b, expected=expected) - self.assertEqual(other_angle(a, b), expected) - - with allure.step("Enter values of two angles and return the 3rd"): - a = 60 - b = 60 - expected = 60 - print_log(a=a, b=b, expected=expected) - self.assertEqual(other_angle(a, b), expected) - - with allure.step("Enter values of two angles and return the 3rd"): - a = 43 - b = 78 - expected = 59 - print_log(a=a, b=b, expected=expected) - self.assertEqual(other_angle(a, b), expected) - - with allure.step("Enter values of two angles and return the 3rd"): - a = 10 - b = 20 - expected = 150 print_log(a=a, b=b, expected=expected) self.assertEqual(other_angle(a, b), expected)