diff --git a/test_time_to_first_response.py b/test_time_to_first_response.py index 79bf353..0cd4843 100644 --- a/test_time_to_first_response.py +++ b/test_time_to_first_response.py @@ -86,6 +86,31 @@ def test_measure_time_to_first_response_ignore_users(self): # Check the results self.assertEqual(result, expected_result) + def test_measure_time_to_first_response_only_ignored_users(self): + """Test that measure_time_to_first_response returns empty for an issue with only ignored users.""" + # Set up the mock GitHub issues + mock_issue1 = MagicMock() + mock_issue1.comments = 1 + mock_issue1.created_at = "2023-01-01T00:00:00Z" + + # Set up the mock GitHub comments (all ignored) + mock_comment1 = MagicMock() + mock_comment1.user.login = "ignored_user" + mock_comment1.created_at = datetime.fromisoformat("2023-01-02T00:00:00Z") + + mock_comment2 = MagicMock() + mock_comment2.user.login = "ignored_user2" + mock_comment2.created_at = datetime.fromisoformat("2023-01-03T00:00:00Z") + + mock_issue1.issue.comments.return_value = [mock_comment1, mock_comment2] + + # Call the function + result = measure_time_to_first_response(mock_issue1, None, ["ignored_user", "ignored_user2"]) + expected_result = None + + # Check the results + self.assertEqual(result, expected_result) + class TestGetAverageTimeToFirstResponse(unittest.TestCase): """Test the get_average_time_to_first_response function."""