From 76221bdb8359796099908b7e8b2785f3c5c66dc2 Mon Sep 17 00:00:00 2001 From: Zach Wolfenbarger Date: Tue, 4 Jun 2024 17:49:36 -0500 Subject: [PATCH] Flake --- panoptes_aggregation/batch_aggregation.py | 1 + .../tests/batch_aggregation/test_batch_aggregation.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/panoptes_aggregation/batch_aggregation.py b/panoptes_aggregation/batch_aggregation.py index c3d26139..74fa9571 100644 --- a/panoptes_aggregation/batch_aggregation.py +++ b/panoptes_aggregation/batch_aggregation.py @@ -63,6 +63,7 @@ def run_aggregation(project_id, workflow_id, user_id): # STDOUT messages get printed to kubernetes logs print(f'Batch Aggregation: Run successful for workflow {workflow_id} by user {user_id}') + class BatchAggregator: """ Bunch of stuff to manage a batch aggregation run diff --git a/panoptes_aggregation/tests/batch_aggregation/test_batch_aggregation.py b/panoptes_aggregation/tests/batch_aggregation/test_batch_aggregation.py index d2bd8b42..8050c359 100644 --- a/panoptes_aggregation/tests/batch_aggregation/test_batch_aggregation.py +++ b/panoptes_aggregation/tests/batch_aggregation/test_batch_aggregation.py @@ -15,7 +15,7 @@ def test_run_aggregation_permission_failure(self, mock_aggregator): mock_aggregator_instance = mock_aggregator.return_value mock_aggregator_instance.check_permission.return_value = False - with self.assertRaises(SystemExit) as leaver: + with self.assertRaises(SystemExit): run_aggregation(1, 10, 100) mock_aggregator_instance.update_panoptes.assert_not_called() @@ -135,7 +135,7 @@ def test_update_panoptes_success(self, mock_get, mock_put): body = {'uuid': ba.id, 'status': 'completed'} ba.update_panoptes(body) mock_get.assert_called_with('/aggregations', params={'workflow_id': 10}) - mock_put.assert_called_with('/aggregations/5555', etag='thisisanetag', json={'aggregations': body }) + mock_put.assert_called_with('/aggregations/5555', etag='thisisanetag', json={'aggregations': body}) @patch("panoptes_aggregation.batch_aggregation.Panoptes.put") @patch("panoptes_aggregation.batch_aggregation.Panoptes.get") @@ -145,7 +145,7 @@ def test_update_panoptes_failure(self, mock_get, mock_put): body = {'status': 'failure'} ba.update_panoptes(body) mock_get.assert_called_with('/aggregations', params={'workflow_id': 10}) - mock_put.assert_called_with('/aggregations/5555', etag='thisisanetag', json={'aggregations': body }) + mock_put.assert_called_with('/aggregations/5555', etag='thisisanetag', json={'aggregations': body}) @patch("panoptes_aggregation.batch_aggregation.BlobServiceClient") def test_connect_blob_storage(self, mock_client):