restored old w_ipa test
@@ -2,7 +2,11 @@ import os
import shutil
from h5diff import H5Diff
import unittest
+import pytest
+import argparse
+from unittest import mock
+from westpa.cli.tools.w_ipa import entry_point
class Test_W_IPA(unittest.TestCase):
@@ -24,3 +28,45 @@ class Test_W_IPA(unittest.TestCase):
shutil.rmtree('ANALYSIS')
os.remove('west.h5')
os.remove('west.cfg')
+
+
+@pytest.mark.skip
+class Test_W_IPA_new:
+
+ def test_run_w_ipa(self, ref_50iter):
+ '''Testing if w_ipa runs as expected and the h5 files looks good.'''
+
+ with mock.patch(
+ target='argparse.ArgumentParser.parse_args',
+ return_value=argparse.Namespace(
+ rcfile=self.cfg_filepath,
+ verbosity='debug',
+ work_manager=None,
+ analysis_mode=True,
+ max_queue_length=None,
+ debug_mode=True,
+ we_h5filename=self.h5_filepath,
+ scheme='TEST',
+ reanalyze=False,
+ ignore_hash=False,
+ plotting=False,
+ construct_dataset=False,
+ dsspecs=None,
+ output='assign.h5',
+ subsample=None,
+ config_from_file=True,
+ ),
+ ):
+ entry_point()
+
+
+ assert os.path.isfile('./ANALYSIS/TEST/assign.h5'), "The assign.h5 file was not generated."
+ assert os.path.isfile('./ANALYSIS/TEST/direct.h5'), "The direct.h5 file was not generated."
+ diff = H5Diff('assign_ipa_ref.h5', './ANALYSIS/TEST/assign.h5')
+ diff.check()
+ # TODO: this is broken
+ # diff2 = H5Diff('direct_ipa_ref.h5', './ANALYSIS/TEST/direct.h5')
+ # diff2.check()
+
+ # cleanup
+ shutil.rmtree('ANALYSIS')
