@@ -576,12 +576,16 @@ def test_write_to_markdown(self):
576
576
"days_inactive" : 30 ,
577
577
"last_push_date" : thirty_days_ago .date ().isoformat (),
578
578
"visibility" : "private" ,
579
+ "days_since_last_release" : None ,
580
+ "days_since_last_pr" : None ,
579
581
},
580
582
{
581
583
"url" : "https://github.com/example/repo2" ,
582
584
"days_inactive" : 40 ,
583
585
"last_push_date" : forty_days_ago .date ().isoformat (),
584
586
"visibility" : "public" ,
587
+ "days_since_last_release" : None ,
588
+ "days_since_last_pr" : None ,
585
589
},
586
590
]
587
591
@@ -591,7 +595,12 @@ def test_write_to_markdown(self):
591
595
mock_file = MagicMock ()
592
596
593
597
# Call the write_to_markdown function with the mock file object
594
- write_to_markdown (inactive_repos , inactive_days_threshold , file = mock_file )
598
+ write_to_markdown (
599
+ inactive_repos ,
600
+ inactive_days_threshold ,
601
+ additional_metrics = ["release" , "pr" ],
602
+ file = mock_file ,
603
+ )
595
604
596
605
# Check that the mock file object was called with the expected data
597
606
expected_calls = [
@@ -602,17 +611,25 @@ def test_write_to_markdown(self):
602
611
call .write (
603
612
"| Repository URL | Days Inactive | Last Push Date | Visibility |"
604
613
),
605
- call .write ("\n | --- | --- | --- | ---: |" ),
614
+ call .write (" Days Since Last Release |" ),
615
+ call .write (" Days Since Last PR |" ),
616
+ call .write ("\n | --- | --- | --- | --- |" ),
617
+ call .write (" --- |" ),
618
+ call .write (" --- |" ),
606
619
call .write ("\n " ),
607
620
call .write (
608
621
f"| https://github.com/example/repo2 | 40 |\
609
622
{ forty_days_ago .date ().isoformat ()} | public |"
610
623
),
624
+ call .write (" None |" ),
625
+ call .write (" None |" ),
611
626
call .write ("\n " ),
612
627
call .write (
613
628
f"| https://github.com/example/repo1 | 30 |\
614
629
{ thirty_days_ago .date ().isoformat ()} | private |"
615
630
),
631
+ call .write (" None |" ),
632
+ call .write (" None |" ),
616
633
call .write ("\n " ),
617
634
]
618
635
mock_file .__enter__ .return_value .assert_has_calls (expected_calls )
0 commit comments