Skip to content

Commit

Permalink
lint updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jleaniz committed Jan 29, 2025
1 parent c29fe28 commit 5f2680d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/lib/processors/openrelik.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def testProcess(
mock_upload_file,
mock_create_workflow,
mock_download_file,
mock_update_folder
mock_update_folder,
):
"""Tests the Process method."""
# Set up the mocks
Expand Down Expand Up @@ -108,7 +108,8 @@ def testProcess(
test_path = "/test/path/*.plaso"

self._module.StoreContainer(
containers.File(name="fake_path", path=test_path))
containers.File(name="fake_path", path=test_path)
)
self._ProcessModule()

# (folder_id, [file_id], template_id)
Expand All @@ -125,22 +126,21 @@ def testDownloadWorkflowOutput(self, mock_publish, mock_download_file):
# Set up mocks
self._module.openrelik_api_client = mock.MagicMock()
self._module.openrelik_api_client.base_url = "http://fake_api:8711"
self._module.openrelik_api_client.download_file.return_value = "fake_filepath"
mock_download_file.return_value = "fake_filepath"
self._module.openrelik_api_client.download_file.return_value = (
"fake_filepath"
)

# Call the method
local_path = self._module.DownloadWorkflowOutput(
123, "test_filename.plaso"
)
local_path = self._module.DownloadWorkflowOutput(123, "test_filename.plaso")
# pylint: disable=line-too-long
self._module.openrelik_api_client.download_file.assert_called_with(
123, "test_filename.plaso")
123, "test_filename.plaso"
)
mock_publish.assert_called_with(
"Saved output for file ID 123 to fake_filepath"
"Saved output for file ID 123 to fake_filepath"
)
self.assertEqual(local_path, "fake_filepath")



if __name__ == "__main__":
unittest.main()

0 comments on commit 5f2680d

Please sign in to comment.