Skip to content

Commit fc753ce

Browse files
Remove HTML Output File from example12_DH.txt to avoid annoying littering of generated files; test HTML output in separate test that outputs to a temp directory instead
1 parent c3dacdd commit fc753ce

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

tests/examples/example12_DH.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ Fracture Height, 300
6060
Fracture Width, 200
6161
Fracture Shape, 4
6262
Well Drilling and Completion Capital Cost, 12
63-
HTML Output File, example12_DH.html

tests/geophires_x_tests/test_outputs.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
import os
22
import sys
3+
import tempfile
34
from pathlib import Path
45

56
from geophires_x.Model import Model
67
from geophires_x_client import GeophiresInputParameters
8+
from geophires_x_client import GeophiresXClient
79
from tests.base_test_case import BaseTestCase
810

911

1012
class OutputsTestCase(BaseTestCase):
1113

14+
def test_html_output_file(self):
15+
html_path = Path(tempfile.gettempdir(), 'example12_DH.html').absolute()
16+
GeophiresXClient().get_geophires_result(
17+
GeophiresInputParameters(
18+
from_file_path=self._get_test_file_path('../examples/example12_DH.txt'),
19+
params={'HTML Output File': str(html_path)},
20+
)
21+
)
22+
self.assertTrue(html_path.exists())
23+
with html_path.open() as f:
24+
html_content = f.read()
25+
self.assertIn('***CASE REPORT***', html_content)
26+
# TODO expand test to assert more about output HTML
27+
1228
def test_relative_output_file_path(self):
1329
input_file = GeophiresInputParameters({'HTML Output File': 'foo.html'}).as_file_path()
1430
m = self._new_model(input_file=input_file, original_cwd=Path('/tmp/')) # noqa: S108

0 commit comments

Comments
 (0)