diff --git a/tests/conftest.py b/tests/conftest.py index e4f7f34..51becee 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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") diff --git a/tests/data/sample_p_tricky/input.tsv b/tests/data/sample_p_tricky/input.tsv new file mode 100644 index 0000000..a937724 --- /dev/null +++ b/tests/data/sample_p_tricky/input.tsv @@ -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 diff --git a/tests/test_app.py b/tests/test_app.py index 6d6963c..280bae7 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -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