From 1b031aeeb0a2816bc153d64d73d47251ec642465 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Thu, 12 Mar 2020 14:07:34 +0000 Subject: [PATCH] Linting --- moto/batch/models.py | 8 +++++--- tests/test_batch/test_batch.py | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/moto/batch/models.py b/moto/batch/models.py index 08f4cbdb2..95ad64789 100644 --- a/moto/batch/models.py +++ b/moto/batch/models.py @@ -342,8 +342,8 @@ class Job(threading.Thread, BaseModel): "status": self.job_state, "dependsOn": [], } - if result['status'] not in ['SUBMITTED', 'PENDING', 'RUNNABLE', 'STARTING']: - result['startedAt'] = datetime2int(self.job_started_at) + if result["status"] not in ["SUBMITTED", "PENDING", "RUNNABLE", "STARTING"]: + result["startedAt"] = datetime2int(self.job_started_at) if self.job_stopped: result["stoppedAt"] = datetime2int(self.job_stopped_at) result["container"] = {} @@ -506,7 +506,9 @@ class Job(threading.Thread, BaseModel): date, line = line.split(" ", 1) date = dateutil.parser.parse(date) # TODO: Replace with int(date.timestamp()) once we yeet Python2 out of the window - date = int((time.mktime(date.timetuple()) + date.microsecond / 1000000.0)) + date = int( + (time.mktime(date.timetuple()) + date.microsecond / 1000000.0) + ) logs.append({"timestamp": date, "message": line.strip()}) # Send to cloudwatch diff --git a/tests/test_batch/test_batch.py b/tests/test_batch/test_batch.py index 6eedf452c..4b75fb857 100644 --- a/tests/test_batch/test_batch.py +++ b/tests/test_batch/test_batch.py @@ -682,6 +682,7 @@ def test_submit_job_by_name(): # SLOW TESTS + @mock_logs @mock_ec2 @mock_ecs @@ -745,7 +746,7 @@ def test_submit_job(): resp = logs_client.get_log_events( logGroupName="/aws/batch/job", logStreamName=ls_name ) - [event['message'] for event in resp["events"]].should.equal(['hello']) + [event["message"] for event in resp["events"]].should.equal(["hello"]) @mock_logs