Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for an awkward pressure fitting case #28

Open
wants to merge 2 commits into
base: Live
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 12 additions & 0 deletions tests/data/sample_p_tricky/input.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#H Bostrom Pressure Test Data RbCuCo(CN)6
0.28246 0.00404 10.79264 9.94964 10.01934 90.0 90.0 90.0
0.54597 0.00682 10.72611 9.92916 10.01096 90.0 90.0 90.0
0.82194 0.00772 10.66755 9.90688 10.00328 90.0 90.0 90.0
1.12088 0.00917 10.60337 9.88151 9.992910 90.0 90.0 90.0
1.42459 0.01061 10.53919 9.85840 9.983770 90.0 90.0 90.0
1.80077 0.01318 10.46293 9.82224 9.970770 90.0 90.0 90.0
2.24237 0.01797 10.37014 9.77598 9.954700 90.0 90.0 90.0
2.82361 0.02499 10.25861 9.72716 9.938910 90.0 90.0 90.0
3.5739 0.03621 10.15985 9.66307 9.913310 90.0 90.0 90.0
4.24775 0.04907 10.07138 9.59475 9.884650 90.0 90.0 90.0
4.81786 0.06139 10.00112 9.55436 9.851440 90.0 90.0 90.0
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