Skip to content

Commit

Permalink
chore: use keyword args instead of positional
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Koppert <[email protected]>
  • Loading branch information
zkoppert committed Oct 23, 2024
1 parent d8dd50a commit da8008c
Showing 1 changed file with 89 additions and 85 deletions.
174 changes: 89 additions & 85 deletions test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,28 @@ def setUp(self):
def test_get_env_vars_with_github_app(self):
"""Test that all environment variables are set correctly using GitHub App"""
expected_result = EnvVars(
12345,
678910,
b"hello",
"",
"",
False,
False,
False,
False,
False,
False,
[],
[],
False,
"10",
"20",
"3",
SEARCH_QUERY,
False,
"",
"",
False,
gh_app_id=12345,
gh_app_installation_id=678910,
gh_app_private_key_bytes=b"hello",
gh_token="",
ghe="",
hide_author=False,
hide_items_closed_count=False,
hide_label_metrics=False,
hide_time_to_answer=False,
hide_time_to_close=False,
hide_time_to_first_response=False,
ignore_user=[],
labels_to_measure=[],
enable_mentor_count=False,
min_mentor_comments="10",
max_comments_eval="20",
heavily_involved_cutoff="3",
search_query=SEARCH_QUERY,
non_mentioning_links=False,
report_title="",
output_file="",
draft_pr_tracking=False,
)
result = get_env_vars(True)
self.assertEqual(str(result), str(expected_result))
Expand Down Expand Up @@ -168,27 +168,27 @@ def test_get_env_vars_with_github_app(self):
def test_get_env_vars_with_token(self):
"""Test that all environment variables are set correctly using a list of repositories"""
expected_result = EnvVars(
None,
None,
b"",
TOKEN,
"",
False,
False,
False,
False,
False,
False,
[],
[],
False,
"10",
"20",
"3",
SEARCH_QUERY,
False,
"",
"",
gh_app_id=None,
gh_app_installation_id=None,
gh_app_private_key_bytes=b"",
gh_token=TOKEN,
ghe="",
hide_author=False,
hide_items_closed_count=False,
hide_label_metrics=False,
hide_time_to_answer=False,
hide_time_to_close=False,
hide_time_to_first_response=False,
ignore_user=[],
labels_to_measure=[],
enable_mentor_count=False,
min_mentor_comments="10",
max_comments_eval="20",
heavily_involved_cutoff="3",
search_query=SEARCH_QUERY,
non_mentioning_links=False,
report_title="",
output_file="",
)
result = get_env_vars(True)
self.assertEqual(str(result), str(expected_result))
Expand Down Expand Up @@ -248,32 +248,36 @@ def test_get_env_vars_missing_query(self):
"OUTPUT_FILE": "issue_metrics.md",
"REPORT_TITLE": "Issue Metrics",
"SEARCH_QUERY": SEARCH_QUERY,
"RATE_LIMIT_BYPASS": "true",
"DRAFT_PR_TRACKING": "True",
},
)
def test_get_env_vars_optional_values(self):
"""Test that optional values are set to their default values if not provided"""
expected_result = EnvVars(
None,
None,
b"",
TOKEN,
"",
True,
True,
True,
True,
True,
True,
[],
["waiting-for-review", "waiting-for-manager"],
False,
10,
20,
3,
SEARCH_QUERY,
True,
"Issue Metrics",
"issue_metrics.md",
gh_app_id=None,
gh_app_installation_id=None,
gh_app_private_key_bytes=b"",
gh_token=TOKEN,
ghe="",
hide_author=True,
hide_items_closed_count=True,
hide_label_metrics=True,
hide_time_to_answer=True,
hide_time_to_close=True,
hide_time_to_first_response=True,
ignore_user=[],
labels_to_measure=["waiting-for-review", "waiting-for-manager"],
enable_mentor_count=False,
min_mentor_comments=10,
max_comments_eval=20,
heavily_involved_cutoff=3,
search_query=SEARCH_QUERY,
non_mentioning_links=True,
report_title="Issue Metrics",
output_file="issue_metrics.md",
rate_limit_bypass=True,
draft_pr_tracking=True,
)
result = get_env_vars(True)
self.assertEqual(str(result), str(expected_result))
Expand All @@ -292,27 +296,27 @@ def test_get_env_vars_optional_values(self):
def test_get_env_vars_optionals_are_defaulted(self):
"""Test that optional values are set to their default values if not provided"""
expected_result = EnvVars(
None,
None,
b"",
"TOKEN",
"",
False,
False,
False,
False,
False,
False,
[],
[],
False,
"10",
"20",
"3",
SEARCH_QUERY,
False,
"Issue Metrics",
"",
gh_app_id=None,
gh_app_installation_id=None,
gh_app_private_key_bytes=b"",
gh_token="TOKEN",
ghe="",
hide_author=False,
hide_items_closed_count=False,
hide_label_metrics=False,
hide_time_to_answer=False,
hide_time_to_close=False,
hide_time_to_first_response=False,
ignore_user=[],
labels_to_measure=[],
enable_mentor_count=False,
min_mentor_comments="10",
max_comments_eval="20",
heavily_involved_cutoff="3",
search_query=SEARCH_QUERY,
non_mentioning_links=False,
report_title="Issue Metrics",
output_file="",
)
result = get_env_vars(True)
self.assertEqual(str(result), str(expected_result))
Expand Down

0 comments on commit da8008c

Please sign in to comment.