@@ -177,7 +177,6 @@ def test_get_per_issue_metrics_with_hide_envs(self):
177
177
"HIDE_TIME_TO_ANSWER" : "false" ,
178
178
"HIDE_TIME_TO_CLOSE" : "false" ,
179
179
"HIDE_TIME_TO_FIRST_RESPONSE" : "false" ,
180
- "OUTPUT_FILE" : "test_issue_metrics.md"
181
180
},
182
181
)
183
182
def test_get_per_issue_metrics_without_hide_envs (self ):
@@ -483,16 +482,10 @@ def test_get_per_issue_metrics_with_discussion_with_hide_envs(self):
483
482
class TestEvaluateMarkdownFileSize (unittest .TestCase ):
484
483
"""Test suite for the evaluate_markdown_file_size function."""
485
484
486
- @patch .dict (
487
- os .environ ,
488
- {
489
- "GH_TOKEN" : "test_token" ,
490
- "SEARCH_QUERY" : "is:issue is:open repo:user/repo" ,
491
- "OUTPUT_FILE" : "test_issue_metrics.md"
492
- }
493
- )
494
485
@patch ("issue_metrics.markdown_too_large_for_issue_body" )
495
- def test_markdown_too_large_for_issue_body_called_with_output_file (self , mock_evaluate ):
486
+ def test_markdown_too_large_for_issue_body_called_with_output_file (
487
+ self , mock_evaluate
488
+ ):
496
489
"""
497
490
Test that the function uses the output_file.
498
491
"""
@@ -501,19 +494,13 @@ def test_markdown_too_large_for_issue_body_called_with_output_file(self, mock_ev
501
494
502
495
mock_evaluate .assert_called_with ("test_issue_metrics.md" , 65535 )
503
496
504
- @patch .dict (
505
- os .environ ,
506
- {
507
- "GH_TOKEN" : "test_token" ,
508
- "SEARCH_QUERY" : "is:issue is:open repo:user/repo" ,
509
- "OUTPUT_FILE" : "test_issue_metrics.md"
510
- }
511
- )
512
497
@patch ("issue_metrics.print" )
513
498
@patch ("shutil.move" )
514
499
@patch ("issue_metrics.split_markdown_file" )
515
500
@patch ("issue_metrics.markdown_too_large_for_issue_body" )
516
- def test_split_markdown_file_when_file_size_too_large (self , mock_evaluate , mock_split , mock_move , mock_print ):
501
+ def test_split_markdown_file_when_file_size_too_large (
502
+ self , mock_evaluate , mock_split , mock_move , mock_print
503
+ ):
517
504
"""
518
505
Test that the function is called with the output_file
519
506
environment variable.
@@ -522,16 +509,18 @@ def test_split_markdown_file_when_file_size_too_large(self, mock_evaluate, mock_
522
509
evaluate_markdown_file_size ("test_issue_metrics.md" )
523
510
524
511
mock_split .assert_called_with ("test_issue_metrics.md" , 65535 )
525
- mock_move .assert_has_calls ([
526
- call ("test_issue_metrics.md" , "test_issue_metrics_full.md" ),
527
- call ("test_issue_metrics_0.md" , "test_issue_metrics.md" )
528
- ])
512
+ mock_move .assert_has_calls (
513
+ [
514
+ call ("test_issue_metrics.md" , "test_issue_metrics_full.md" ),
515
+ call ("test_issue_metrics_0.md" , "test_issue_metrics.md" ),
516
+ ]
517
+ )
529
518
mock_print .assert_called_with (
530
519
"Issue metrics markdown file is too large for GitHub issue body and has been \
531
520
split into multiple files. ie. test_issue_metrics.md, test_issue_metrics_1.md, etc. \
532
521
The full file is saved as test_issue_metrics_full.md\n \
533
522
See https://github.com/github/issue-metrics/blob/main/docs/dealing-with-large-issue-metrics.md"
534
- )
523
+ )
535
524
536
525
537
526
if __name__ == "__main__" :
0 commit comments