Skip to content

Commit 755029b

Browse files
Update unit test #360
1 parent 747f93e commit 755029b

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

tests/test_protocol.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,16 @@ def test_default_protocol():
4646

4747
def test_to_table(example_protocol: Protocol):
4848
"""Ensure that the protocol can be correctly converted to a table."""
49-
df = example_protocol.to_table()
50-
assert df is not None
51-
assert "Protocol Parameter" in df.columns
52-
assert "Value" in df.columns
53-
assert "Units" in df.columns
54-
assert df[df["Protocol Parameter"] == "ID"]["Value"].iloc[0] == "example_protocol"
49+
t = example_protocol.to_table()
50+
assert t is not None
51+
assert "Category" in t.columns
52+
assert "Name" in t.columns
53+
assert "Value" in t.columns
54+
assert "Unit" in t.columns
55+
tm =t.set_index(["Category", "Name"])
56+
assert tm.loc["","ID"]["Value"] == example_protocol.id
57+
assert tm.loc["Delay Method", "Default Sound Speed"]["Value"] == 1540.0
58+
assert tm.loc["Delay Method", "Default Sound Speed"]["Unit"] == "m/s"
5559

5660
@pytest.mark.parametrize(
5761
"target_constraints",

0 commit comments

Comments
 (0)