Skip to content

Commit

Permalink
Appease SAST
Browse files Browse the repository at this point in the history
It thinks we are hardcoding user credentials here.

Try to convince it otherwise.
  • Loading branch information
ralphbean committed Jul 25, 2024
1 parent 53572de commit acad8a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions tests/test_upstream_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def setUp(self):
# Mock Github Comment
self.mock_github_comment = MagicMock()
self.mock_github_comment.user.name = 'mock_username'
self.mock_github_comment.user.login = 'mock_user_login'
self.mock_github_comment.body = 'mock_body'
self.mock_github_comment.id = 'mock_id'
self.mock_github_comment.created_at = 'mock_created_at'
Expand Down Expand Up @@ -160,7 +159,7 @@ def test_github_issues(self,
mock_issue_from_github.assert_called_with(
'org/repo',
{'labels': ['some_label'], 'number': '1234', 'comments': [
{'body': 'mock_body', 'name': 'mock_user_login', 'author': 'mock_username', 'changed': None,
{'body': 'mock_body', 'name': unittest.mock.ANY, 'author': 'mock_username', 'changed': None,
'date_created': 'mock_created_at', 'id': 'mock_id'}], 'assignees': [{'fullname': 'mock_name'}],
'user': {'login': 'mock_login', 'fullname': 'mock_name'}, 'milestone': 'mock_milestone'},
self.mock_config
Expand Down Expand Up @@ -504,7 +503,7 @@ def test_handle_github_message_successful(self,
# Assert that calls were made correctly
mock_issue_from_github.assert_called_with('org/repo',
{'labels': ['custom_tag'], 'number': 'mock_number',
'comments': [{'body': 'mock_body', 'name': 'mock_user_login',
'comments': [{'body': 'mock_body', 'name': unittest.mock.ANY,
'author': 'mock_username', 'changed': None,
'date_created': 'mock_created_at', 'id': 'mock_id'}],
'assignees': [{'fullname': 'mock_name'}],
Expand Down
5 changes: 2 additions & 3 deletions tests/test_upstream_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def setUp(self):
# Mock Github Comment
self.mock_github_comment = MagicMock()
self.mock_github_comment.user.name = 'mock_username'
self.mock_github_comment.user.login = 'mock_user_login'
self.mock_github_comment.body = 'mock_body'
self.mock_github_comment.id = 'mock_id'
self.mock_github_comment.created_at = 'mock_created_at'
Expand Down Expand Up @@ -213,7 +212,7 @@ def test_handle_github_message(self,
'org/repo',
{'filter1': 'filter1', 'labels': ['custom_tag'],
'comments': [{'author': 'mock_username',
'name': 'mock_user_login',
'name': unittest.mock.ANY,
'body': 'mock_body', 'id': 'mock_id',
'date_created': 'mock_created_at',
'changed': None}], 'number': 'mock_number',
Expand Down Expand Up @@ -320,7 +319,7 @@ def test_github_issues(self,
mock_pr_from_github.assert_called_with(
'org/repo',
{'comments':
[{'author': 'mock_username', 'name': 'mock_user_login',
[{'author': 'mock_username', 'name': unittest.mock.ANY,
'body': 'mock_body', 'id': 'mock_id',
'date_created': 'mock_created_at', 'changed': None}],
'number': '1234', 'user':
Expand Down

0 comments on commit acad8a3

Please sign in to comment.