Skip to content

Commit

Permalink
chore: remove json output assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
sust4in committed Aug 22, 2024
1 parent 56e4a1c commit 867e158
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def test_scan(self, mock_tempdir, mock_make_archive, mock_post, mock_get):
mock_make_archive.return_value = os.path.join(tempfile.gettempdir(), 'test.zip')
mock_get.return_value.status_code = 200
mock_post.return_value.status_code = 200
mock_post.return_value.json.return_value = {"scan_id": "fake_scan_id"}

# Retrieve secrets from environment variables
org = os.environ.get('CODETHREAT_ORG')
Expand All @@ -40,7 +39,6 @@ def test_scan(self, mock_tempdir, mock_make_archive, mock_post, mock_get):
'--url', url, '--token', token, '--org', org])

print(result.output) # For debugging purposes
print(mock_post.return_value.json.return_value) # For debugging the mock's json response
self.assertEqual(result.exit_code, SUCCESS_EXIT_CODE)
self.assertIn("[CT*] Scan started successfully", result.output)
mock_make_archive.assert_called_once()
Expand All @@ -54,7 +52,7 @@ def test_scan_project_creation(self, mock_post, mock_get):
mock_post.side_effect = [
MagicMock(status_code=200,
json=MagicMock(return_value={"result": {"message": "successfull"}, "error": False})),
MagicMock(status_code=200, json=MagicMock(return_value={"scan_id": "fake_scan_id"}))
MagicMock(status_code=200)
]

# Retrieve secrets from environment variables
Expand All @@ -70,7 +68,6 @@ def test_scan_project_creation(self, mock_post, mock_get):
'--url', url, '--token', token, '--org', org])

print(result.output) # For debugging purposes
print(mock_post.return_value.json.return_value) # For debugging the mock's json response
self.assertEqual(result.exit_code, SUCCESS_EXIT_CODE)
self.assertIn("[CT*] Project 'new_project' created successfully.", result.output)
self.assertIn("[CT*] Scan started successfully", result.output)
Expand Down

0 comments on commit 867e158

Please sign in to comment.