Fix: ApproximateArrivalTimestamp should be epoch with millisecond precision (#3764)

The Record class was already capturing a unix timestamp, but it was incorrectly
converting it to ISO format when sending back to the client.

Updating the model to return the correct timestamp necessitated a minor change
to one of the tests because `botocore` converts non-timezone aware timestamps
to local time.
This commit is contained in:
Brian Pandola 2021-03-11 00:54:21 -08:00 committed by GitHub
commit f96ac40fca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -6,6 +6,7 @@ import time
import boto.kinesis
import boto3
from boto.kinesis.exceptions import ResourceNotFoundException, InvalidArgumentException
from dateutil.tz import tzlocal
from moto import mock_kinesis, mock_kinesis_deprecated
from moto.core import ACCOUNT_ID
@ -378,7 +379,7 @@ def test_get_records_timestamp_filtering():
conn.put_record(StreamName=stream_name, Data="0", PartitionKey="0")
time.sleep(1.0)
timestamp = datetime.datetime.utcnow()
timestamp = datetime.datetime.now(tz=tzlocal())
conn.put_record(StreamName=stream_name, Data="1", PartitionKey="1")