-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better double asterisk support (#572)
- Loading branch information
Showing
5 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import fsspec | ||
import pytest | ||
from fsspec.tests.abstract import AbstractFixtures | ||
|
||
from gcsfs.core import GCSFileSystem | ||
from gcsfs.tests.conftest import allfiles | ||
from gcsfs.tests.settings import TEST_BUCKET | ||
|
||
|
||
class GcsfsFixtures(AbstractFixtures): | ||
@pytest.fixture(scope="class") | ||
def fs(self, docker_gcs): | ||
GCSFileSystem.clear_instance_cache() | ||
gcs = fsspec.filesystem("gcs", endpoint_url=docker_gcs) | ||
try: | ||
# ensure we're empty. | ||
try: | ||
gcs.rm(TEST_BUCKET, recursive=True) | ||
except FileNotFoundError: | ||
pass | ||
try: | ||
gcs.mkdir(TEST_BUCKET) | ||
except Exception: | ||
pass | ||
|
||
gcs.pipe({TEST_BUCKET + "/" + k: v for k, v in allfiles.items()}) | ||
gcs.invalidate_cache() | ||
yield gcs | ||
finally: | ||
try: | ||
gcs.rm(gcs.find(TEST_BUCKET)) | ||
gcs.rm(TEST_BUCKET) | ||
except: # noqa: E722 | ||
pass | ||
|
||
@pytest.fixture | ||
def fs_path(self): | ||
return TEST_BUCKET | ||
|
||
@pytest.fixture | ||
def supports_empty_directories(self): | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import fsspec.tests.abstract as abstract | ||
|
||
from gcsfs.tests.derived.gcsfs_fixtures import GcsfsFixtures | ||
|
||
|
||
class TestGcsfsCopy(abstract.AbstractCopyTests, GcsfsFixtures): | ||
pass | ||
|
||
|
||
class TestGcsfsGet(abstract.AbstractGetTests, GcsfsFixtures): | ||
pass | ||
|
||
|
||
class TestGcsfsPut(abstract.AbstractPutTests, GcsfsFixtures): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters