Skip to content

Commit

Permalink
add test for no object
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanyang0528 committed May 23, 2020
1 parent ed7a260 commit 524f59e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion testing/test_awswrangler/test_moto.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,22 @@ def test_list_directories_succeed(s3):
"s3://bucket/bar/bar.tmp"])


def test_describe_no_object_succeed(s3):

desc = wr.s3.describe_objects("s3://bucket")

assert isinstance(desc, dict)
assert desc == {}


def test_describe_one_object_succeed(s3):
bucket = "bucket"
key = "foo/foo.tmp"
s3_object = s3.Object(bucket, key)
s3_object.put(Body=b'foo')

desc = wr.s3.describe_objects("s3://{}/{}".format(bucket, key))
print(desc)

assert isinstance(desc, dict)
assert list(desc.keys()) == ['s3://bucket/foo/foo.tmp']

Expand Down

0 comments on commit 524f59e

Please sign in to comment.