2015-09-14 21:42:25 -04:00
|
|
|
import glob
|
|
|
|
|
import os
|
2018-01-29 10:53:46 -06:00
|
|
|
|
|
|
|
|
from tests.testing_harness import TestHarness
|
2013-02-01 15:22:32 -05:00
|
|
|
|
|
|
|
|
|
2015-06-25 00:10:07 -06:00
|
|
|
class SourcepointTestHarness(TestHarness):
|
|
|
|
|
def _test_output_created(self):
|
|
|
|
|
"""Make sure statepoint.* and source* have been created."""
|
|
|
|
|
TestHarness._test_output_created(self)
|
2018-01-29 10:53:46 -06:00
|
|
|
source = glob.glob('source.*.h5')
|
2015-06-25 00:10:07 -06:00
|
|
|
assert len(source) == 1, 'Either multiple or no source files ' \
|
|
|
|
|
'exist.'
|
2013-02-01 15:22:32 -05:00
|
|
|
|
2015-09-14 21:05:58 -04:00
|
|
|
def _cleanup(self):
|
|
|
|
|
TestHarness._cleanup(self)
|
2018-01-29 10:53:46 -06:00
|
|
|
output = glob.glob('source.*.h5')
|
2015-09-14 21:05:58 -04:00
|
|
|
for f in output:
|
|
|
|
|
if os.path.exists(f):
|
|
|
|
|
os.remove(f)
|
|
|
|
|
|
2014-02-25 13:21:54 -05:00
|
|
|
|
2018-01-29 12:10:24 -06:00
|
|
|
def test_statepoint_sourcesep():
|
2017-04-07 10:25:24 -05:00
|
|
|
harness = SourcepointTestHarness('statepoint.10.h5')
|
2015-06-29 18:50:53 -06:00
|
|
|
harness.main()
|