Skip to content

Commit

Permalink
Add a test for an awkward pressure fitting case
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Nov 7, 2023
1 parent 2457ca0 commit 5267c10
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def sample_p():
return load_sample_inputs("sample_p/input.tsv")


@fixture
def sample_p_tricky():
return load_sample_inputs("sample_p_tricky/input.tsv")


@fixture
def sample_q():
return load_sample_inputs("sample_q/input.tsv")
Expand Down
21 changes: 21 additions & 0 deletions tests/data/sample_p_tricky/input.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
0.001 0.001 10.497 3.6309 6.1772 90.00 106.97 90.00
0.196 0.001 10.495 3.6297 6.1740 90.00 106.98 90.00
0.398 0.001 10.496 3.6279 6.1684 90.00 106.96 90.00
0.598 0.001 10.495 3.6271 6.1648 90.00 106.95 90.00
0.796 0.001 10.494 3.6260 6.1593 90.00 106.95 90.00
0.993 0.001 10.492 3.6252 6.1557 90.00 106.97 90.00
1.199 0.001 10.490 3.6240 6.1515 90.00 106.98 90.00
1.399 0.001 10.488 3.6227 6.1476 90.00 106.97 90.00
1.593 0.001 10.487 3.6217 6.1441 90.00 106.99 90.00
1.794 0.001 10.486 3.6210 6.1409 90.00 107.01 90.00
1.996 0.001 10.487 3.6197 6.1362 90.00 107.01 90.00
2.196 0.001 10.487 3.6187 6.1323 90.00 107.01 90.00
2.397 0.001 10.486 3.6177 6.1285 90.00 107.01 90.00
2.597 0.001 10.485 3.6174 6.1248 90.00 107.02 90.00
2.798 0.001 10.484 3.6164 6.1213 90.00 107.02 90.00
2.997 0.001 10.483 3.6153 6.1180 90.00 107.03 90.00
3.198 0.001 10.482 3.6141 6.1143 90.00 107.02 90.00
3.397 0.001 10.481 3.6130 6.1105 90.00 107.02 90.00
3.598 0.001 10.481 3.6120 6.1071 90.00 107.03 90.00
3.798 0.001 10.480 3.6114 6.1032 90.00 107.05 90.00
3.998 0.001 10.480 3.6106 6.0994 90.00 107.06 90.00
27 changes: 27 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,33 @@ def test_p_no_pc_sample_data(
assert len(tables) == 7


def test_p_tricky_sample_data(
client,
sample_p_tricky,
parser,
):
post_parameters = {
"DataType": "Pressure",
"EulerianStrain": "True",
"FiniteStrain": "True",
"DegPolyCap": "",
"DegPolyVol": "",
"UsePc": "False",
"PcVal": "",
"data": sample_p_tricky,
}

response = client.post("/output", data=post_parameters)
assert response.status_code == 200

html_response = [d for d in response.response]
assert len(html_response) == 1

soup = parser(html_response[0])
tables = soup.find_all("table")
assert len(tables) == 7


def test_parse_options():
from PASCal.options import Options, PASCalDataType

Expand Down

0 comments on commit 5267c10

Please sign in to comment.