Skip to content

Commit

Permalink
Fix Python 2.7 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gruebel committed Feb 28, 2021
1 parent 094ce5e commit e47c3cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions moto/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ def put_events(self, events):
"detail-type": event["DetailType"],
"source": event["Source"],
"account": ACCOUNT_ID,
"time": event.get("Time", datetime.utcnow().timestamp()),
"time": event.get("Time", unix_time(datetime.utcnow())),
"region": self.region_name,
"resources": event.get("Resources", []),
"detail": json.loads(event["Detail"]),
Expand Down Expand Up @@ -1100,7 +1100,7 @@ def list_replays(self, name_prefix, source_arn, state):
"Use either : State, EventSourceArn, or NamePrefix."
)

valid_states = [item.value for item in ReplayState]
valid_states = sorted([item.value for item in ReplayState])
if state and state not in valid_states:
raise ValidationException(
"1 validation error detected: "
Expand Down
2 changes: 1 addition & 1 deletion tests/test_events/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ def test_list_replays_error_invalid_state():
"1 validation error detected: "
"Value 'invalid' at 'state' failed to satisfy constraint: "
"Member must satisfy enum value set: "
"[STARTING, RUNNING, CANCELLING, COMPLETED, CANCELLED, FAILED]"
"[CANCELLED, CANCELLING, COMPLETED, FAILED, RUNNING, STARTING]"
)


Expand Down

0 comments on commit e47c3cb

Please sign in to comment.