Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
clean tests
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Jan 30, 2024
1 parent 27d37eb commit 451f01d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def compare(dir1, dir2):
files1 = set(os.listdir(dir1))
files2 = set(os.listdir(dir2))
files = files1.union(files2)

for f in files:
path1 = os.path.join(dir1, f)
path2 = os.path.join(dir2, f)
Expand All @@ -47,8 +47,8 @@ def compare(dir1, dir2):

assert os.path.isfile(path2), f"File {path2} does not exist"

content1 = open(path1,'rb').read()
content2 = open(path2,'rb').read()
content1 = open(path1, "rb").read()
content2 = open(path2, "rb").read()

if f == ".zattrs":
compare_dot_zattrs(json.loads(content1), json.loads(content2))
Expand All @@ -66,17 +66,22 @@ def _test_create(name):
output = os.path.join(here, name + "-output", name + ".zarr")
reference = os.path.join(here, name + "-reference", name + ".zarr")

c = Creator(output, config=config, cache=None, overwrite=True)
# cache=None is using the default cache
c = Creator(
output,
config=config,
cache=None,
overwrite=True,
)
c.create()

# ds = open_dataset(zarr_path)
# assert ds.shape ==
# assert ds.variables ==
# assert ds.shape ==
# assert ds.variables ==

compare(reference, output)



def test_create_concat():
_test_create("create-concat")

Expand Down

0 comments on commit 451f01d

Please sign in to comment.