Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry committed Apr 11, 2024
1 parent b99f549 commit 6885f10
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 @@ -515,6 +515,19 @@ def test_get_put_file_in_dir(protocol, gcs):
assert gcs.cat(protocol + TEST_BUCKET + "/temp_dir/accounts.1.json") == data1


@pytest.mark.parametrize("protocol", ["", "gs://", "gcs://"])
def test_get_file_to_current_working_directory(monkeypatch, protocol, gcs):
fn = protocol + TEST_BUCKET + "/temp"
gcs.pipe(fn, b"hello world")

with tempdir() as dn:
os.makedirs(dn)
monkeypatch.chdir(dn)
gcs.get_file(fn, "temp")
with open("temp", mode="rb") as f:
assert f.read() == b"hello world"


def test_special_characters_filename(gcs: GCSFileSystem):
special_filename = """'!"`#$%&'()+,-.<=>?@[]^_{}~/'"""
full_path = TEST_BUCKET + "/" + special_filename
Expand Down

0 comments on commit 6885f10

Please sign in to comment.