Skip to content

Commit

Permalink
Add metadata tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKraus committed Nov 20, 2024
1 parent a941e13 commit e1c3ff4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_99_example_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
("counter_multistep", 15, "results.1"),
],
)
def test_counter_npoints(
def test_counter_npoints_metadata(
casename, npoints, prefix, datadir, start_tomato_daemon, stop_tomato_daemon
):
os.chdir(datadir)
Expand All @@ -40,6 +40,8 @@ def test_counter_npoints(
ds = dt["counter"]
print(f"{ds=}")
assert ds["uts"].size == npoints
assert "tomato_version" in dt.attrs
assert "tomato_Job" in dt.attrs


@pytest.mark.parametrize(
Expand Down Expand Up @@ -70,7 +72,7 @@ def test_counter_cancel(casename, datadir, start_tomato_daemon, stop_tomato_daem
("counter_snapshot", False),
],
)
def test_counter_snapshot(
def test_counter_snapshot_metadata(
casename, external, datadir, start_tomato_daemon, stop_tomato_daemon
):
os.chdir(datadir)
Expand All @@ -85,6 +87,9 @@ def test_counter_snapshot(
status = utils.job_status(1)
assert status == "c"
assert os.path.exists("snapshot.1.nc")
dt = xr.open_datatree("snapshot.1.nc")
assert "tomato_version" in dt.attrs
assert "tomato_Job" in dt.attrs


@pytest.mark.parametrize(
Expand Down

0 comments on commit e1c3ff4

Please sign in to comment.