Skip to content

Commit

Permalink
Remove HTML Output File from example12_DH.txt to avoid annoying litte…
Browse files Browse the repository at this point in the history
…ring of generated files; test HTML output in separate test that outputs to a temp directory instead
  • Loading branch information
softwareengineerprogrammer committed Oct 15, 2024
1 parent c3dacdd commit fc753ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/examples/example12_DH.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions tests/geophires_x_tests/test_outputs.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit fc753ce

Please sign in to comment.