Skip to content

Commit f000828

Browse files
committed
test: refactoring lint ignores
1 parent b298d1f commit f000828

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

bootprocess/tests/test_views_helper.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def __init__(self, username=""):
2121

2222
@pytest.mark.parametrize(
2323
(
24-
"testName, userIsInDefaultAccessGroup,"
25-
" groupCount"
24+
"_test_name, user_is_in_default_access_group,"
25+
" group_count"
2626
),
2727
[
2828
# user is not part of default group and has respective count of git repo,
@@ -31,7 +31,8 @@ def __init__(self, username=""):
3131
("UserInDefaultGroup", False, 40),
3232
],
3333
)
34-
def test_getDashboardData(monkeypatch, testName, userIsInDefaultAccessGroup, groupCount): # noqa: C901
34+
def test_get_dashboard_data(monkeypatch, _test_name, user_is_in_default_access_group, group_count):
35+
""" method to test get_dashboard_data """
3536
class MockUserModelobj:
3637
""" mocking method UserModelobj """
3738
def __init__(self, user="", gitusername="", name=""):
@@ -78,7 +79,7 @@ def filter(self, user="", status="", access__access_tag=""):
7879
if access__access_tag == "ssh":
7980
return []
8081
group = []
81-
for i in range(groupCount):
82+
for i in range(group_count):
8283
group.append(i)
8384
return group
8485

@@ -116,12 +117,12 @@ def save(self):
116117
return ""
117118

118119
def __str__(self):
119-
if userIsInDefaultAccessGroup:
120+
if user_is_in_default_access_group:
120121
return DEFAULT_ACCESS_GROUP
121122
return ""
122123

123124
def __len__(self):
124-
return groupCount
125+
return group_count
125126

126127
class MockThread:
127128
""" class for mocking Thread """
@@ -146,4 +147,4 @@ def mock_thread(*_, **__):
146147
request = MockRequest(username="username1")
147148
context = views_helper.get_dashboard_data(request)
148149
assert context["regions"] == ["eu-central-1"]
149-
assert context["groupCount"] == groupCount
150+
assert context["groupCount"] == group_count

pylama.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ ignore = W0718,W0719,E1101
1414
[pylama:Access/accessrequest_helper.py]
1515
ignore = W1202,R901,R0911,C0302,R0914
1616

17-
[pylama:bootprocess/tests/test_views_helper.py]
18-
ignore = R0903
17+
[pylama:*/tests/test_*]
18+
ignore = R0903,C901
19+
; R0903: too-few-public-methods
20+
; C901: Function is too complex
1921

2022
[pylama:vulture]
2123
min-confidence = 100

0 commit comments

Comments
 (0)