Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant committed Aug 24, 2023
1 parent 4f829c0 commit f2fd210
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gcsfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,9 @@ async def _glob(self, path, prefix="", **kwargs):
prefix = path[:ind].split("/")[-1]
return await super()._glob(path, prefix=prefix, **kwargs)

async def _ls(self, path, detail=False, prefix="", versions=False, refresh=False, **kwargs):
async def _ls(
self, path, detail=False, prefix="", versions=False, refresh=False, **kwargs
):
"""List objects under the given '/{bucket}/{prefix} path."""
path = self._strip_protocol(path).rstrip("/")

Expand Down
2 changes: 2 additions & 0 deletions gcsfs/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,14 @@ def test_ls_detail(gcs):
L = gcs.ls(TEST_BUCKET + "/nested", detail=True)
assert all(isinstance(item, dict) for item in L)


@pytest.mark.parametrize("refresh", (False, True))
def test_ls_refresh(gcs, refresh):
with mock.patch.object(gcs, "invalidate_cache") as mock_invalidate_cache:
gcs.ls(TEST_BUCKET, refresh=refresh)
assert mock_invalidate_cache.called is refresh


def test_gcs_glob(gcs):
fn = TEST_BUCKET + "/nested/file1"
assert fn not in gcs.glob(TEST_BUCKET + "/")
Expand Down

0 comments on commit f2fd210

Please sign in to comment.