diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-04-23 16:58:19 -0400 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-05-06 10:35:43 -0400 |
| commit | 75bb46cc454fdef0585f0a460f36f579b59f0356 (patch) | |
| tree | 4e429c3b82510ac9078d4ef0ef79ee176f114a97 /scripts/pr_quality/tests | |
| parent | 57b23d15259c32dba80bb093645242f1b3b25365 (diff) | |
Replaced old PR quality comments when writing new ones.
Diffstat (limited to 'scripts/pr_quality/tests')
| -rw-r--r-- | scripts/pr_quality/tests/test_check_pr.py | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/scripts/pr_quality/tests/test_check_pr.py b/scripts/pr_quality/tests/test_check_pr.py index c7565df5ab..30bfa26512 100644 --- a/scripts/pr_quality/tests/test_check_pr.py +++ b/scripts/pr_quality/tests/test_check_pr.py @@ -781,8 +781,16 @@ class TestIntegration(BaseTestCase): body = make_pr_body(ticket="", checked_items=0) result, _, mock_gh = self.call_main(pr_body=body, commit_count=1) self.assertEqual(result, 1) - mock_gh.assert_called_once_with( - "POST", "/issues/10/comments", "test-token", "test/repo", mock.ANY + self.assertEqual( + mock_gh.call_args_list, + [ + mock.call( + "GET", "/issues/10/comments", "test-token", "test/repo", mock.ANY + ), + mock.call( + "POST", "/issues/10/comments", "test-token", "test/repo", mock.ANY + ), + ], ) def test_untrusted_author_failures_posts_comment_and_closes(self): @@ -790,9 +798,12 @@ class TestIntegration(BaseTestCase): result, _, mock_gh = self.call_main(pr_body=body) self.assertEqual(result, 1) self.assertEqual( - mock_gh.mock_calls, + mock_gh.call_args_list, [ mock.call( + "GET", "/issues/10/comments", "test-token", "test/repo", mock.ANY + ), + mock.call( "POST", "/issues/10/comments", "test-token", "test/repo", mock.ANY ), mock.call( @@ -806,9 +817,12 @@ class TestIntegration(BaseTestCase): result, _, mock_gh = self.call_main(pr_body=body, pr_author="") self.assertEqual(result, 1) self.assertEqual( - mock_gh.mock_calls, + mock_gh.call_args_list, [ mock.call( + "GET", "/issues/10/comments", "test-token", "test/repo", mock.ANY + ), + mock.call( "POST", "/issues/10/comments", "test-token", "test/repo", mock.ANY ), mock.call( @@ -821,8 +835,16 @@ class TestIntegration(BaseTestCase): body = make_pr_body(ticket="", checked_items=0) result, _, mock_gh = self.call_main(pr_body=body, autoclose=False) self.assertEqual(result, 1) - mock_gh.assert_called_once_with( - "POST", "/issues/10/comments", "test-token", "test/repo", mock.ANY + self.assertEqual( + mock_gh.call_args_list, + [ + mock.call( + "GET", "/issues/10/comments", "test-token", "test/repo", mock.ANY + ), + mock.call( + "POST", "/issues/10/comments", "test-token", "test/repo", mock.ANY + ), + ], ) def test_warnings_only_posts_comment_does_not_close(self): @@ -833,8 +855,16 @@ class TestIntegration(BaseTestCase): pr_body=VALID_PR_BODY, pr_title="", trac_data=trac_data ) self.assertIsNone(result) - mock_gh.assert_called_once_with( - "POST", "/issues/10/comments", "test-token", "test/repo", mock.ANY + self.assertEqual( + mock_gh.call_args_list, + [ + mock.call( + "GET", "/issues/10/comments", "test-token", "test/repo", mock.ANY + ), + mock.call( + "POST", "/issues/10/comments", "test-token", "test/repo", mock.ANY + ), + ], ) def test_warnings_alongside_failures_still_closes(self): @@ -844,9 +874,12 @@ class TestIntegration(BaseTestCase): result, _, mock_gh = self.call_main(pr_body=body, trac_data=trac_data) self.assertEqual(result, 1) self.assertEqual( - mock_gh.mock_calls, + mock_gh.call_args_list, [ mock.call( + "GET", "/issues/10/comments", "test-token", "test/repo", mock.ANY + ), + mock.call( "POST", "/issues/10/comments", "test-token", "test/repo", mock.ANY ), mock.call( |
