o-nikolas commented on code in PR #31640:
URL: https://github.com/apache/airflow/pull/31640#discussion_r1214725450
##########
tests/providers/amazon/aws/hooks/test_s3.py:
##########
@@ -230,14 +231,16 @@ def dummy_object_filter(keys, from_datetime=None,
to_datetime=None):
return []
assert [] == hook.list_keys(s3_bucket, prefix="non-existent/")
- assert ["a", "dir/b"] == hook.list_keys(s3_bucket)
- assert ["a"] == hook.list_keys(s3_bucket, delimiter="/")
+ assert ["a", "ba", "dir/b"] == hook.list_keys(s3_bucket)
+ assert ["a", "ba"] == hook.list_keys(s3_bucket, delimiter="/")
assert ["dir/b"] == hook.list_keys(s3_bucket, prefix="dir/")
- assert ["dir/b"] == hook.list_keys(s3_bucket, start_after_key="a")
+ assert ["ba", "dir/b"] == hook.list_keys(s3_bucket,
start_after_key="a")
assert [] == hook.list_keys(s3_bucket, from_datetime=from_datetime,
to_datetime=to_datetime)
assert [] == hook.list_keys(
s3_bucket, from_datetime=from_datetime, to_datetime=to_datetime,
object_filter=dummy_object_filter
)
+ assert [] == hook.list_keys(s3_bucket, prefix="*a")
+ assert ["a", "ba"] == hook.list_keys(s3_bucket, prefix="*a",
apply_wildcard=True)
Review Comment:
Can you add test cases for the wildcard in the middle and end of the prefix
string as well, otherwise, lgtm!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]