Skip to content

Commit

Permalink
Add more test cases about fsspec integration
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghua committed Nov 14, 2024
1 parent 1049986 commit 01026ec
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions tosfs/tests/test_fsspec_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from tos import EnvCredentialsProvider

from tosfs import TosFileSystem
from tosfs.core import logger
from tosfs.utils import random_str


Expand Down Expand Up @@ -74,11 +73,8 @@ def test_fsspec_open(bucket, temporary_workspace):
class MyTosFileSystem(TosFileSystem):
"""A sub class of TosFileSystem."""

protocol = ("tos",)

def __init__(self):
"""Init MyTosFileSystem."""
logger.error("+++++++++++++++++")
super().__init__(
endpoint_url=os.environ.get("TOS_ENDPOINT"),
region=os.environ.get("TOS_REGION"),
Expand All @@ -87,18 +83,7 @@ def __init__(self):


def test_customized_class(bucket, temporary_workspace):
# known_implementations["tos"] = {
# "class": "tosfs.tests.test_fsspec_integration.MyTosFileSystem"
# }
fsspec.register_implementation("tos", MyTosFileSystem, True)
# fsspec._registry = "tosfs.tests.test_fsspec_integration.MyTosFileSystem"

logger.error("----------------")
logger.error("tos" in fsspec.registry)
logger.error(f"fsspec.registry {fsspec.registry}")
logger.error(known_implementations)
logger.error(known_implementations["tos"])
logger.error(fsspec.get_filesystem_class("tos"))

file = f"{random_str()}.txt"
content = "Hello TOSFS."
Expand Down

0 comments on commit 01026ec

Please sign in to comment.