Skip to content

Commit

Permalink
Merge pull request #560 from iKostanOrg/kyu6
Browse files Browse the repository at this point in the history
Merge pull request #559 from iKostanOrg/master
  • Loading branch information
ikostan authored Dec 15, 2024
2 parents 08c9a50 + 66ff141 commit c70acf3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 40 deletions.
9 changes: 3 additions & 6 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: "2" # required to adjust maintainability checks
version: "2" # required to adjust maintainability checks

checks:
import-error:
Expand All @@ -8,12 +8,9 @@ checks:
enabled: false
no-name-in-module:
enabled: false
# Per-Language Mass Threshold Defaults
# https://docs.codeclimate.com/docs/duplication#section-understand-the-engine
similar-code:
config:
threshold: 68 #overriding will affect all languages
threshold: 68
identical-code:
config:
threshold: 32 #overriding will affect all languages
# ... CONFIG CONTENT ...
threshold: 32
10 changes: 3 additions & 7 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ rules:
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
comments: disable
comments-indentation: disable
document-start: disable
empty-lines: enable
empty-values: disable
float-values: disable
Expand Down
49 changes: 22 additions & 27 deletions kyu_6/a_rule_of_divisibility_by_13/test_thirt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
Test for -> A Rule of Divisibility by 13
Test for -> A Rule of Divisibility by 13.
Created by Egor Kostan.
GitHub: https://github.com/ikostan
"""
Expand All @@ -8,6 +9,7 @@

import unittest
import allure
from parameterized import parameterized
from kyu_6.a_rule_of_divisibility_by_13.thirt import thirt
from utils.log_func import print_log

Expand All @@ -23,14 +25,21 @@
url='https://www.codewars.com/kata/564057bc348c7200bd0000ff',
name='Source/Kata')
class ThirtTestCase(unittest.TestCase):
"""
Testing 'thirt' function
"""
"""Testing 'thirt' function."""

@parameterized.expand([
(1234567, 87),
(321, 48),
(8529, 79),
(85299258, 31),
(5634, 57),
(1111111111, 71),
(987654321, 30)])
# pylint: disable-msg=R0801
def test_thirt(self):
def test_thirt(self, n, expected):
"""
Testing 'thirt' function with various test data
Testing 'thirt' function with various test data.
:return:
"""
allure.dynamic.title("Testing 'thirt' function")
Expand All @@ -44,26 +53,12 @@ def test_thirt(self):
"on an integer n (>=0). 'thirt' should return the stationary"
" number.</p>")
# pylint: enable-msg=R0801
test_data: tuple = (
(1234567, 87),
(321, 48),
(8529, 79),
(85299258, 31),
(5634, 57),
(1111111111, 71),
(987654321, 30))

for n, expected in test_data:
actual_result = thirt(n)
# pylint: disable-msg=R0801
with allure.step(f"Enter a n ({n}) and verify the "
f"expected output ({expected}) vs "
f"actual result ({actual_result})"):

print_log(n=n,
expected=expected,
result=actual_result)

self.assertEqual(expected,
actual_result)
actual_result = thirt(n)
# pylint: disable-msg=R0801
with allure.step(f"Enter a n ({n}) and verify the "
f"expected output ({expected}) vs "
f"actual result ({actual_result})"):
print_log(n=n, expected=expected, result=actual_result)
self.assertEqual(expected, actual_result)
# pylint: enable-msg=R0801

0 comments on commit c70acf3

Please sign in to comment.