From 524f59e5c0514da3bebf71ace47cde9d20a4cbac Mon Sep 17 00:00:00 2001 From: Bryan Date: Sat, 23 May 2020 22:59:49 +0800 Subject: [PATCH] add test for no object --- testing/test_awswrangler/test_moto.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/testing/test_awswrangler/test_moto.py b/testing/test_awswrangler/test_moto.py index 3bb8bca52..fde0d78cb 100644 --- a/testing/test_awswrangler/test_moto.py +++ b/testing/test_awswrangler/test_moto.py @@ -72,6 +72,14 @@ 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" @@ -79,7 +87,7 @@ def test_describe_one_object_succeed(s3): 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']