Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgarde committed Nov 30, 2023
1 parent 366faa9 commit 815e01a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions podaac/swodlr_ingest_to_sds/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ingest_sf_arn = utils.get_param('stepfunction_arn')
logger = utils.get_logger(__name__)


def lambda_handler(event, _context):
'''Starts step function execution'''

Expand Down
5 changes: 3 additions & 2 deletions podaac/swodlr_ingest_to_sds/poll_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def lambda_handler(event, _context):
status = info['status']
timestamp = datetime.now().isoformat()
logger.debug('granule id: %s; job id: %s; status: %s',
granule_id, job_id, status)
granule_id, job_id, status)

update_expression = (
'SET #status = :status'
Expand Down Expand Up @@ -98,5 +98,6 @@ def _extract_cpt(granule_id):
'product': parsed_id.group('product'),
'cycle': str(int(parsed_id.group('cycle'))),
'pass': str(int(parsed_id.group('pass'))),
'tile': str(int(parsed_id.group('tile'))) + parsed_id.group('direction')
'tile': str(int(parsed_id.group('tile')))
+ parsed_id.group('direction')
}
10 changes: 7 additions & 3 deletions tests/test_submit_to_sds.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'''Tests for the submit_to_sds module'''
from unittest import TestCase
from unittest.mock import patch
import importlib
from pathlib import Path
import json
from os import environ
Expand All @@ -21,6 +20,7 @@
):
from podaac.swodlr_ingest_to_sds import submit_to_sds


class TestSubmitToSds(TestCase):
'''Tests for the submit_to_sds module'''
data_path = Path(__file__).parent.joinpath('data')
Expand All @@ -42,12 +42,14 @@ def test_valid_submit(self, _):

submit_to_sds.lambda_handler(self.valid_event, None)

# pylint: disable=no-member
submit_calls = submit_to_sds.ingest_job_type.submit_job.call_args_list
# pylint: disable=no-member
input_calls = submit_to_sds.ingest_job_type.set_input_params\
.call_args_list
# pylint: disable=no-member,unnecessary-dunder-call
put_item_calls = submit_to_sds.utils.ingest_table.batch_writer().__enter__()\
.put_item.call_args_list
put_item_calls = submit_to_sds.utils.ingest_table.batch_writer()\
.__enter__().put_item.call_args_list

self.assertEqual(len(input_calls), 3)
self.assertEqual(len(submit_calls), 3)
Expand Down Expand Up @@ -124,6 +126,8 @@ def tearDown(self):
Reset mocks after each test run
'''

# pylint: disable=no-member
submit_to_sds.ingest_job_type.set_input_params.reset_mock()
# pylint: disable=no-member
submit_to_sds.ingest_job_type.submit_job.reset_mock()
submit_to_sds.dynamodb.batch_get_item.reset_mock()

0 comments on commit 815e01a

Please sign in to comment.