Skip to content

Commit

Permalink
Make location html repr tests more manageable
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-kipawa committed Sep 6, 2024
1 parent 6a18b99 commit be42be8
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions tests/test_network_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ def test_single_node_html_repr(node):
padding: 0px;
padding-left: 2em;
}
</style>
<details><summary>Attributes (8)</summary><ul><li>id: 1</li><li>type: Manhole</li><li>xcoord: -687934.6000976562</li><li>ycoord: -1056500.69921875</li><li>ground_level: 197.07000732421875</li><li>bottom_level: 195.0500030517578</li><li>critical_level: inf</li><li>diameter: 1.0</li></ul></details><details><summary>Quantities (1)</summary><ul><li>WaterLevel</li></ul></details>"""
assert html_repr == expected_html_repr
</style>"""
assert expected_html_repr in html_repr


def test_single_catchment_html_repr(catchment):
Expand All @@ -59,9 +58,8 @@ def test_single_catchment_html_repr(catchment):
padding: 0px;
padding-left: 2em;
}
</style>
<details><summary>Attributes (3)</summary><ul><li>id: 100_16_16</li><li>area: 22800.0</li><li>type: Kinematic Wave</li></ul></details><details><summary>Quantities (5)</summary><ul><li>TotalRunOff</li><li>ActualRainfall</li><li>ZinkLoadRR</li><li>ZinkMassAccumulatedRR</li><li>ZinkRR</li></ul></details>"""
assert html_repr == expected_html_repr
</style>"""
assert expected_html_repr in html_repr


def test_single_reach_html_repr(river_reach):
Expand All @@ -73,9 +71,8 @@ def test_single_reach_html_repr(river_reach):
padding: 0px;
padding-left: 2em;
}
</style>
<details><summary>Attributes (5)</summary><ul><li>name: river</li><li>length: 2024.2276598819008</li><li>start_chainage: 53100.0</li><li>end_chainage: 55124.2276598819</li><li>n_gridpoints: 94</li></ul></details><details><summary>Quantities (4)</summary><ul><li>WaterLevel</li><li>ManningResistanceNumber</li><li>Discharge</li><li>FlowVelocity</li></ul></details>"""
assert html_repr == expected_html_repr
</style>"""
assert expected_html_repr in html_repr


def test_single_structure_html_repr(structure):
Expand All @@ -87,6 +84,5 @@ def test_single_structure_html_repr(structure):
padding: 0px;
padding-left: 2em;
}
</style>
<details><summary>Attributes (3)</summary><ul><li>id: 119w1</li><li>type: Weir</li><li>chainage: 0.5</li></ul></details><details><summary>Quantities (1)</summary><ul><li>Discharge</li></ul></details>"""
assert html_repr == expected_html_repr
</style>"""
assert expected_html_repr in html_repr

0 comments on commit be42be8

Please sign in to comment.