Skip to content

Commit

Permalink
Add test_move_recursive (#575)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Durant <[email protected]>
  • Loading branch information
ianthomas23 and martindurant committed Aug 25, 2023
1 parent a17043a commit e64ede3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gcsfs/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,19 @@ def test_move(gcs):
assert not gcs.exists(fn)


@pytest.mark.parametrize("slash_from", ([False, True]))
def test_move_recursive(gcs, slash_from):
# See issue #489
dir_from = TEST_BUCKET + "/nested"
if slash_from:
dir_from += "/"
dir_to = TEST_BUCKET + "/new_name"

gcs.mv(dir_from, dir_to, recursive=True)
assert not gcs.exists(dir_from)
assert gcs.ls(dir_to) == [dir_to + "/file1", dir_to + "/file2", dir_to + "/nested2"]


def test_cat_file(gcs):
fn = TEST_BUCKET + "/test/accounts.1.json"
data = gcs.cat_file(fn)
Expand Down

0 comments on commit e64ede3

Please sign in to comment.