Skip to content

Commit fdc4ece

Browse files
committed
fix(test_ci): mock requests.get in test_start_ci_empty_token to prevent rate-limit flakiness
1 parent 1062055 commit fdc4ece

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_ci/test_controllers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2406,8 +2406,9 @@ def test_blocked_users_empty_token(self):
24062406
c.post("/blocked_users", data=dict(user_id=999, comment="Test user", add=True))
24072407
self.assertIsNotNone(BlockedUsers.query.filter(BlockedUsers.user_id == 999).first())
24082408

2409+
@mock.patch('requests.get', side_effect=mock_api_request_github)
24092410
@mock.patch('run.get_github_config')
2410-
def test_start_ci_empty_token(self, mock_get_github_config):
2411+
def test_start_ci_empty_token(self, mock_get_github_config, mock_requests):
24112412
"""Test start_ci returns 500 when GitHub token is empty."""
24122413
payload = {'ref': 'refs/heads/master', 'after': 'abc123'}
24132414
headers = self.generate_header(payload, 'push')

0 commit comments

Comments
 (0)