@@ -1001,10 +1001,11 @@ def _files(blobs):
10011001 assert {s3obj .key for s3obj in s3objs } == {key for key , _ in shuffled_blobs }
10021002
10031003
1004+ @pytest .mark .parametrize ("s3root" , S3ROOT_VARIANTS , ids = ["no_slash" , "with_slash" ])
10041005@pytest .mark .parametrize ("inject_failure_rate" , [0 , 10 , 50 , 90 ])
1005- def test_list_recursive_sibling_prefix_filtering (inject_failure_rate ):
1006+ def test_list_recursive_sibling_prefix_filtering (s3root , inject_failure_rate ):
10061007 test_prefix = f"test_log_filtering_{ uuid4 ().hex [:8 ]} "
1007- base_s3root = s3_data . S3ROOT
1008+ base_s3root = s3root
10081009
10091010 test_files = [
10101011 f"{ test_prefix } /log/test.txt" ,
@@ -1017,23 +1018,17 @@ def test_list_recursive_sibling_prefix_filtering(inject_failure_rate):
10171018 s3_setup .put (file_path , f"test content for { file_path } " )
10181019
10191020 with S3 (
1020- s3root = f" { base_s3root } / { test_prefix } / log/" ,
1021+ s3root = os . path . join ( base_s3root , test_prefix , " log" ) ,
10211022 inject_failure_rate = inject_failure_rate ,
10221023 ) as s3 :
10231024 objects = s3 .list_recursive ()
10241025
1025- found_relative_paths = []
1026- for obj in objects :
1027- # Get path relative to our test prefix
1028- relative_path = obj .url .replace (f"{ base_s3root } /{ test_prefix } /" , "" )
1029- found_relative_paths .append (relative_path )
1026+ found_relative_paths = [obj .key for obj in objects ]
10301027
1031- expected_under_log = ["log/ test.txt" ]
1028+ expected_under_log = ["test.txt" ]
10321029
10331030 invalid_paths = [
1034- path
1035- for path in found_relative_paths
1036- if path .startswith (("log_other/" , "something/" ))
1031+ path for path in found_relative_paths if path .startswith ("_other" )
10371032 ]
10381033
10391034 assert len (invalid_paths ) == 0 , (
0 commit comments