From 7999db8a3b343d890afe532113088ff1c020357d Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Mon, 23 Sep 2024 20:32:21 -0700 Subject: [PATCH] ==kyu_7.powers_of_3 kyu_7/easy_line/__init__.py:1:0: R0801: Similar lines in 2 files ==kyu_7.powers_of_3.test_largest_power:[33:40] ==kyu_7.sum_of_two_lowest_int.test_sum_two_smallest_numbers:[30:37] allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html('

Codewars badge:

' '' '

Test Description:

' "

") (duplicate-code) --- kyu_7/powers_of_3/largest_power.py | 9 +++-- kyu_7/powers_of_3/test_largest_power.py | 49 +++++++++++++++---------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/kyu_7/powers_of_3/largest_power.py b/kyu_7/powers_of_3/largest_power.py index 2af7d8a6cb5..3f7bc81846f 100644 --- a/kyu_7/powers_of_3/largest_power.py +++ b/kyu_7/powers_of_3/largest_power.py @@ -1,6 +1,8 @@ -# Created by Egor Kostan. -# GitHub: https://github.com/ikostan -# LinkedIn: https://www.linkedin.com/in/egor-kostan/ +""" +Solution for -> Powers of 3 +Created by Egor Kostan. +GitHub: https://github.com/ikostan +""" def largestPower(N: int) -> int: @@ -11,7 +13,6 @@ def largestPower(N: int) -> int: :param N: :return: """ - result: int = 0 n: int = 0 while result < N: diff --git a/kyu_7/powers_of_3/test_largest_power.py b/kyu_7/powers_of_3/test_largest_power.py index d1a50f4327b..05e4b4be3f9 100644 --- a/kyu_7/powers_of_3/test_largest_power.py +++ b/kyu_7/powers_of_3/test_largest_power.py @@ -1,8 +1,11 @@ -# Created by Egor Kostan. -# GitHub: https://github.com/ikostan -# LinkedIn: https://www.linkedin.com/in/egor-kostan/ +""" +Test for -> Powers of 3 +Created by Egor Kostan. +GitHub: https://github.com/ikostan +""" -# ALGORITHMS LOOPS CONTROL FLOW BASIC LANGUAGE FEATURES FUNDAMENTALS MATHEMATICS NUMBERS +# ALGORITHMS LOOPS CONTROL FLOW BASIC LANGUAGE FEATURES +# FUNDAMENTALS MATHEMATICS NUMBERS import unittest import allure @@ -16,9 +19,16 @@ @allure.sub_suite("Unit Tests") @allure.feature("Flow Control") @allure.story('Powers of 3') -@allure.tag() -@allure.link(url='', - name='Source/Kata') +@allure.tag('ALGORITHMS', + 'LOOPS', + 'CONTROL FLOW', + 'BASIC LANGUAGE FEATURES', + 'FUNDAMENTALS', + 'MATHEMATICS', + 'NUMBERS') +@allure.link( + url='https://www.codewars.com/kata/57be674b93687de78c0001d9/train/python', + name='Source/Kata') class LargestPowerTestCase(unittest.TestCase): """ Testing largestPower function @@ -29,25 +39,24 @@ def test_largest_power(self): Testing largestPower function :return: """ - + # pylint: disable-msg=R0801 allure.dynamic.title("Testing largestPower function") allure.dynamic.severity(allure.severity_level.NORMAL) - allure.dynamic.description_html('

Codewars badge:

' - '' - '

Test Description:

' - "

") - + allure.dynamic.description_html( + '

Codewars badge:

' + '' + '

Test Description:

' + "

") + # pylint: enable-msg=R0801 with allure.step("Pass an integer and verify the output"): - n = 3 - expected = 0 - + n: int = 3 + expected: int = 0 print_log(N=n, expected=expected) self.assertEqual(largestPower(n), expected) with allure.step("Pass an integer and verify the output"): - n = 4 - expected = 1 - + n: int = 4 + expected: int = 1 print_log(N=n, expected=expected) self.assertEqual(largestPower(n), expected)