Skip to content

Commit 1e63343

Browse files
committed
Remove unused utils
1 parent 0424ab3 commit 1e63343

File tree

2 files changed

+1
-50
lines changed

2 files changed

+1
-50
lines changed

good_first_issues/utils/__init__.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -159,30 +159,6 @@ def gql_rate_limit() -> int:
159159
return payload["data"].get("rateLimit").get("remaining")
160160

161161

162-
def identify_limit(limit: Optional[int], all: bool) -> Optional[int]:
163-
"""
164-
Define the value of limiter based on the values passed.
165-
"""
166-
if limit:
167-
return limit
168-
elif all:
169-
return None
170-
else:
171-
return 10
172-
173-
174-
def get_row_ids(issue_count: int, limiter: Optional[int]) -> List[int]:
175-
"""
176-
Generate custom Row Index Column for the table.
177-
Returns a Iterable.
178-
"""
179-
180-
# Check limit is None or greater than total issues fetched
181-
if limiter is None or issue_count < limiter:
182-
return [i for i in range(1, issue_count + 1)]
183-
return [i for i in range(1, limiter + 1)]
184-
185-
186162
def web_server(html_data):
187163
"""
188164
Start web server for obtained issues.

tests/test_utils.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,7 @@
22

33
import pytest
44

5-
from good_first_issues.utils import get_row_ids, identify_limit, parse_period
6-
7-
8-
@pytest.mark.parametrize(
9-
"limit, all, expected",
10-
[(50, False, 50), (None, False, 10), (None, True, None), (50, True, 50)],
11-
)
12-
def test_identify_limit(limit, all, expected):
13-
"""
14-
Check correctness of `limiter` value returned.
15-
"""
16-
assert identify_limit(limit, all) == expected
17-
18-
19-
@pytest.mark.parametrize(
20-
"issues, limiter, expected",
21-
[(10, None, list(range(1, 11))), (100, 10, list(range(1, 11)))],
22-
)
23-
def test_get_row_ids(issues, limiter, expected):
24-
"""
25-
Check correctness of iterable returned.
26-
"""
27-
assert get_row_ids(issues, limiter) == expected
28-
29-
30-
# ------- TEST parse_period -------
5+
from good_first_issues.utils import parse_period
316

327

338
# Fixture to mock the current time for consistent testing

0 commit comments

Comments
 (0)