def test_shallow_find(s3):
    """Test that find method respects maxdepth.

    Verify that the ``find`` method respects the ``maxdepth`` parameter.  With
    ``maxdepth=1``, the results of ``find`` should be the same as those of
    ``ls``, without returning subdirectories.  See also issue 378.
    """
    ls_output = s3.ls(test_bucket_name)
    assert sorted(ls_output + [test_bucket_name]) == s3.find(
        test_bucket_name, maxdepth=1, withdirs=True
    )
    assert ls_output == s3.glob(test_bucket_name + "/*")
Test that find method respects maxdepth.

Verify that the ``find`` method respects the ``maxdepth`` parameter.  With
``maxdepth=1``, the results of ``find`` should be the same as those of
``ls``, without returning subdirectories.  See also issue 378.
s3fs/tests/test_s3fs.py