Skip to content

Commit

Permalink
tasks | test for delete s3 objects
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Apr 1, 2022
1 parent ede121d commit 2ad05cd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/common/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from core.collections.models import Collection
from core.common.constants import HEAD, OCL_ORG_ID, SUPER_ADMIN_USER_ID
from core.common.tasks import delete_s3_objects
from core.common.utils import (
compact_dict_by_values, to_snake_case, flower_get, task_exists, parse_bulk_import_task_id,
to_camel_case,
Expand Down Expand Up @@ -789,3 +790,10 @@ def test_model_name(self):
def test_app_name(self):
self.assertEqual(Concept().app_name, 'concepts')
self.assertEqual(Source().app_name, 'sources')


class TaskTest(OCLTestCase):
@patch('core.common.tasks.S3')
def test_delete_s3_objects(self, s3_mock):
delete_s3_objects('/some/path')
s3_mock.delete_objects.assert_called_once_with('/some/path')

0 comments on commit 2ad05cd

Please sign in to comment.