diff --git a/tests/examples/example12_DH.txt b/tests/examples/example12_DH.txt index d121470f..48955c28 100644 --- a/tests/examples/example12_DH.txt +++ b/tests/examples/example12_DH.txt @@ -60,4 +60,3 @@ Fracture Height, 300 Fracture Width, 200 Fracture Shape, 4 Well Drilling and Completion Capital Cost, 12 -HTML Output File, example12_DH.html diff --git a/tests/geophires_x_tests/test_outputs.py b/tests/geophires_x_tests/test_outputs.py index 5cd6c9a2..e221d675 100644 --- a/tests/geophires_x_tests/test_outputs.py +++ b/tests/geophires_x_tests/test_outputs.py @@ -1,14 +1,30 @@ import os import sys +import tempfile from pathlib import Path from geophires_x.Model import Model from geophires_x_client import GeophiresInputParameters +from geophires_x_client import GeophiresXClient from tests.base_test_case import BaseTestCase class OutputsTestCase(BaseTestCase): + def test_html_output_file(self): + html_path = Path(tempfile.gettempdir(), 'example12_DH.html').absolute() + GeophiresXClient().get_geophires_result( + GeophiresInputParameters( + from_file_path=self._get_test_file_path('../examples/example12_DH.txt'), + params={'HTML Output File': str(html_path)}, + ) + ) + self.assertTrue(html_path.exists()) + with html_path.open() as f: + html_content = f.read() + self.assertIn('***CASE REPORT***', html_content) + # TODO expand test to assert more about output HTML + def test_relative_output_file_path(self): input_file = GeophiresInputParameters({'HTML Output File': 'foo.html'}).as_file_path() m = self._new_model(input_file=input_file, original_cwd=Path('/tmp/')) # noqa: S108