Skip to content

Commit

Permalink
fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMarconato committed Jan 31, 2025
1 parent a8be620 commit ce686e4
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions tests/io/test_remote_mock.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import shlex
import shutil
import subprocess
import time
import uuid
Expand All @@ -17,10 +16,11 @@
from spatialdata import SpatialData
from spatialdata.testing import assert_spatial_data_objects_are_identical


## Mock setup from https://github.com/fsspec/universal_pathlib/blob/main/upath/tests/conftest.py
def posixify(path):
return str(path).replace("\\", "/")
# TODO: check if the tests work on Windows. If yes, we can remove this commented function and the already commented
# place where it is called
# def posixify(path):
# return str(path).replace("\\", "/")


class DummyTestFS(LocalFileSystem):
Expand Down Expand Up @@ -143,12 +143,13 @@ def http_server(tmp_path_factory):
proc.wait()


@pytest.fixture
def http_fixture(local_testdir, http_server):
http_path, http_url = http_server
shutil.rmtree(http_path)
shutil.copytree(local_testdir, http_path)
yield http_url
# TODO: delete this fixture if it is not used
# @pytest.fixture
# def http_fixture(local_testdir, http_server):
# http_path, http_url = http_server
# shutil.rmtree(http_path)
# shutil.copytree(local_testdir, http_path)
# yield http_url


class TestRemoteMock:
Expand Down Expand Up @@ -221,13 +222,15 @@ def _test_table(self, upath: UPath, table: SpatialData) -> None:
assert_spatial_data_objects_are_identical(table, sdata)

def _test_read_elem(self, upath: UPath, table: SpatialData) -> None:
tmpdir = upath / "tmp.zarr"
store = zarr.open()
table.write(tmpdir)
# location of table

sdata = SpatialData.read(tmpdir)
assert_spatial_data_objects_are_identical(elem, sdata)
pass
# TODO: fix
# tmpdir = upath / "tmp.zarr"
# store = zarr.open()
# table.write(tmpdir)
# # location of table
#
# sdata = SpatialData.read(tmpdir)
# assert_spatial_data_objects_are_identical(elem, sdata)

# TODO: fix this test
@pytest.mark.xfail(reason="Fails because remote support for TableElement not yet implemented")
Expand Down

0 comments on commit ce686e4

Please sign in to comment.