Skip to content

Commit

Permalink
Add missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Jan 29, 2024
1 parent 8ba4ebc commit 1d92556
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions python/ribasim/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,23 @@ def test_write_adds_fid_in_tables(basic, tmp_path):
model_orig.write(tmp_path / "basic/ribasim.toml")
with connect(tmp_path / "basic/database.gpkg") as connection:
query = f"select * from {esc_id('Basin / profile')}"
df = pd.read_sql_query(query, connection, parse_dates=["time"])
df = pd.read_sql_query(query, connection)
assert "fid" in df.columns
fids = df.get("fid")
fids = df["fid"]
assert fids.equals(pd.Series(range(1, len(fids) + 1)))

query = "select fid from Node"
df = pd.read_sql_query(query, connection)
assert "fid" in df.columns
fids = df["fid"]
assert fids.equals(pd.Series(range(1, len(fids) + 1)))

query = "select fid from Edge"
df = pd.read_sql_query(query, connection)
assert "fid" in df.columns
fids = df["fid"]
assert fids.equals(pd.Series(range(0, len(fids))))


def test_model_merging(basic, subnetwork, tmp_path):
model = deepcopy(basic)
Expand Down

0 comments on commit 1d92556

Please sign in to comment.