Skip to content

Commit

Permalink
test for comment times being overwritten
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Koppert <zkoppert@github.com>
  • Loading branch information
zkoppert committed Aug 7, 2023
1 parent d436710 commit 3d63f98
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test_time_to_first_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ def test_measure_time_to_first_response(self):
"""
# Set up the mock GitHub issues
mock_issue1 = MagicMock()
mock_issue1.comments = 1
mock_issue1.comments = 2
mock_issue1.created_at = "2023-01-01T00:00:00Z"

mock_comment1 = MagicMock()
mock_comment1.created_at = datetime.fromisoformat("2023-01-02T00:00:00Z")
mock_issue1.issue.comments.return_value = [mock_comment1]
mock_comment2 = MagicMock()
mock_comment2.created_at = datetime.fromisoformat("2023-01-02T12:00:00Z")
mock_issue1.issue.comments.return_value = [mock_comment1, mock_comment2]

# Call the function
result = measure_time_to_first_response(mock_issue1, None)
Expand Down Expand Up @@ -105,7 +107,9 @@ def test_measure_time_to_first_response_only_ignored_users(self):
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"])
result = measure_time_to_first_response(
mock_issue1, None, ["ignored_user", "ignored_user2"]
)
expected_result = None

# Check the results
Expand Down

0 comments on commit 3d63f98

Please sign in to comment.