Skip to content

Commit 52f6f5f

Browse files
committed
Add a test for an awkward pressure fitting case
1 parent 2457ca0 commit 52f6f5f

3 files changed

Lines changed: 53 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ def sample_p():
2525
return load_sample_inputs("sample_p/input.tsv")
2626

2727

28+
@fixture
29+
def sample_p_tricky():
30+
return load_sample_inputs("sample_p_tricky/input.tsv")
31+
32+
2833
@fixture
2934
def sample_q():
3035
return load_sample_inputs("sample_q/input.tsv")
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
0.001 0.001 10.497 3.6309 6.1772 90.00 106.97 90.00
2+
0.196 0.001 10.495 3.6297 6.1740 90.00 106.98 90.00
3+
0.398 0.001 10.496 3.6279 6.1684 90.00 106.96 90.00
4+
0.598 0.001 10.495 3.6271 6.1648 90.00 106.95 90.00
5+
0.796 0.001 10.494 3.6260 6.1593 90.00 106.95 90.00
6+
0.993 0.001 10.492 3.6252 6.1557 90.00 106.97 90.00
7+
1.199 0.001 10.490 3.6240 6.1515 90.00 106.98 90.00
8+
1.399 0.001 10.488 3.6227 6.1476 90.00 106.97 90.00
9+
1.593 0.001 10.487 3.6217 6.1441 90.00 106.99 90.00
10+
1.794 0.001 10.486 3.6210 6.1409 90.00 107.01 90.00
11+
1.996 0.001 10.487 3.6197 6.1362 90.00 107.01 90.00
12+
2.196 0.001 10.487 3.6187 6.1323 90.00 107.01 90.00
13+
2.397 0.001 10.486 3.6177 6.1285 90.00 107.01 90.00
14+
2.597 0.001 10.485 3.6174 6.1248 90.00 107.02 90.00
15+
2.798 0.001 10.484 3.6164 6.1213 90.00 107.02 90.00
16+
2.997 0.001 10.483 3.6153 6.1180 90.00 107.03 90.00
17+
3.198 0.001 10.482 3.6141 6.1143 90.00 107.02 90.00
18+
3.397 0.001 10.481 3.6130 6.1105 90.00 107.02 90.00
19+
3.598 0.001 10.481 3.6120 6.1071 90.00 107.03 90.00
20+
3.798 0.001 10.480 3.6114 6.1032 90.00 107.05 90.00
21+
3.998 0.001 10.480 3.6106 6.0994 90.00 107.06 90.00

tests/test_app.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,33 @@ def test_p_no_pc_sample_data(
234234
assert len(tables) == 7
235235

236236

237+
def test_p_tricky_sample_data(
238+
client,
239+
sample_p_tricky,
240+
parser,
241+
):
242+
post_parameters = {
243+
"DataType": "Pressure",
244+
"EulerianStrain": "True",
245+
"FiniteStrain": "True",
246+
"DegPolyCap": "",
247+
"DegPolyVol": "",
248+
"UsePc": "False",
249+
"PcVal": "",
250+
"data": sample_p_tricky,
251+
}
252+
253+
response = client.post("/output", data=post_parameters)
254+
assert response.status_code == 200
255+
256+
html_response = [d for d in response.response]
257+
assert len(html_response) == 1
258+
259+
soup = parser(html_response[0])
260+
tables = soup.find_all("table")
261+
assert len(tables) == 7
262+
263+
237264
def test_parse_options():
238265
from PASCal.options import Options, PASCalDataType
239266

0 commit comments

Comments
 (0)