2015-09-14 21:42:25 -04:00
|
|
|
import os
|
2018-01-29 10:53:46 -06:00
|
|
|
import glob
|
|
|
|
|
|
|
|
|
|
from tests.testing_harness import TestHarness
|
2013-02-01 15:22:32 -05:00
|
|
|
|
|
|
|
|
|
2015-06-25 00:10:07 -06:00
|
|
|
class OutputTestHarness(TestHarness):
|
|
|
|
|
def _test_output_created(self):
|
|
|
|
|
"""Make sure output files have been created."""
|
|
|
|
|
# Check for the statepoint.
|
|
|
|
|
TestHarness._test_output_created(self)
|
2013-02-01 15:22:32 -05:00
|
|
|
|
2015-06-25 00:10:07 -06:00
|
|
|
# Check for the summary.
|
|
|
|
|
summary = glob.glob(os.path.join(os.getcwd(), 'summary.*'))
|
|
|
|
|
assert len(summary) == 1, 'Either multiple or no summary file exists.'
|
2015-09-04 12:50:19 +07:00
|
|
|
assert summary[0].endswith('h5'),\
|
|
|
|
|
'Summary file is not a HDF5 file.'
|
2013-02-01 15:22:32 -05:00
|
|
|
|
2015-06-25 00:10:07 -06:00
|
|
|
def _cleanup(self):
|
|
|
|
|
TestHarness._cleanup(self)
|
2018-01-29 10:53:46 -06:00
|
|
|
f = 'summary.h5'
|
|
|
|
|
if os.path.exists(f):
|
|
|
|
|
os.remove(f)
|
2013-02-01 15:22:32 -05:00
|
|
|
|
2014-02-25 11:18:51 -05:00
|
|
|
|
2018-01-29 12:10:24 -06:00
|
|
|
def test_output():
|
2017-04-07 10:25:24 -05:00
|
|
|
harness = OutputTestHarness('statepoint.10.h5')
|
2015-06-29 18:50:53 -06:00
|
|
|
harness.main()
|