Skip to content

Commit

Permalink
678: Added testcase that should pass but currently fails for observat…
Browse files Browse the repository at this point in the history
…ion cross-sections.
  • Loading branch information
tim-vd-aardweg committed Jul 8, 2024
1 parent 1ca3e07 commit f3a7391
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/dflowfm/test_obscrosssection.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from typing import List

import pytest
Expand Down Expand Up @@ -154,6 +155,20 @@ def test_create(self):
assert isinstance(model.observationcrosssection, List)
assert len(model.observationcrosssection) == 0

def test_model_can_be_saved_and_loaded(self, tmp_path: Path):
model = ObservationCrossSectionModel()
obs_crosssection = ObservationCrossSection(
name="testName",
branchId="testbranch",
chainage=123,
)
model.observationcrosssection.append(obs_crosssection)
model.observationcrosssection.append(obs_crosssection)

obs_crs_file = tmp_path / "test_crs.ini"
model.save(filepath=obs_crs_file)
_ = ObservationCrossSectionModel(filepath=obs_crs_file)


def _create_observation_cross_section_values() -> dict:
values = dict(
Expand Down

0 comments on commit f3a7391

Please sign in to comment.