Skip to content

Commit 261295a

Browse files
committed
Test for #378 to verify find respects maxdepth.
Added a test to verify that the find method respects the maxdepth parameter. With ``maxdepth=1``, the results of ``find`` should be the same as those ``ls``, without returning subdirectories. See also issue 378.
1 parent f94478e commit 261295a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

s3fs/tests/test_s3fs.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,3 +1679,15 @@ async def async_wrapper():
16791679
await s3._s3.close()
16801680

16811681
asyncio.run(_())
1682+
1683+
1684+
def test_shallow_find(s3):
1685+
"""Test that find method respects maxdepth.
1686+
1687+
Verify that the ``find`` method respects the ``maxdepth`` parameter. With
1688+
``maxdepth=1``, the results of ``find`` should be the same as those of
1689+
``ls``, without returning subdirectories. See also issue 378.
1690+
"""
1691+
1692+
assert s3.ls(test_bucket_name) == s3.find(test_bucket_name, maxdepth=1)
1693+
assert s3.ls(test_bucket_name) == s3.glob(test_bucket_name + "/*")

0 commit comments

Comments
 (0)