Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhanson committed Dec 5, 2019
1 parent 03541ae commit b131d99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ def test_find(s3mock):
def test_latest_inventory():
url = 's3://sentinel-inventory/sentinel-s1-l1c/sentinel-s1-l1c-inventory'
suffix = 'productInfo.json'
for f in s3().latest_inventory(url, suffix=suffix):
session = boto3.Session()
_s3 = s3(session)
for f in _s3.latest_inventory(url, suffix=suffix):
dt = datetime.strptime(f['LastModifiedDate'], "%Y-%m-%dT%H:%M:%S.%fZ")
hours = (datetime.today() - dt).seconds // 3600
assert(hours < 24)
assert(f['url'].endswith(suffix))
break
for f in s3().latest_inventory(url):
for f in _s3.latest_inventory(url):
dt = datetime.strptime(f['LastModifiedDate'], "%Y-%m-%dT%H:%M:%S.%fZ")
hours = (datetime.today() - dt).seconds // 3600
assert(hours < 24)
Expand Down

0 comments on commit b131d99

Please sign in to comment.