diff --git a/CHANGES.rst b/CHANGES.rst index 8dc2ed87..d7060bb6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,6 +12,7 @@ Production Development *********** +:0.1.3: 2016-12-07 -- Py2 & Py3: passes all unit tests :0.1.2: 2016-11-21 -- unit tests added for reports :0.0.9: 2016-06-29 -- retry failed https requests to GitHub and cleanup a QString :0.0.8: 2016-06-29 -- refactor update procedure diff --git a/src/punx/VERSION b/src/punx/VERSION index 8294c184..7693c96b 100644 --- a/src/punx/VERSION +++ b/src/punx/VERSION @@ -1 +1 @@ -0.1.2 \ No newline at end of file +0.1.3 \ No newline at end of file diff --git a/tests/validate_test.py b/tests/validate_test.py index 7ad6499c..3b4fb0d3 100644 --- a/tests/validate_test.py +++ b/tests/validate_test.py @@ -48,8 +48,12 @@ class Validate_NXdata_is_now_optional_51(unittest.TestCase): def setUp(self): self.testfile = common.getTestFileName() + self.validator = None def tearDown(self): + if self.validator is not None and isinstance(self.validator.h5, h5py.File): + self.validator.h5.close() + self.validator = None common.cleanup() def test_simple_NXdata(self): @@ -67,19 +71,20 @@ def test_simple_NXdata(self): hdf5root.close() punx.logs.ignore_logging() - validator = punx.validate.Data_File_Validator(self.testfile) - validator.validate() + self.validator = punx.validate.Data_File_Validator(self.testfile) + self.validator.validate() self.report = [] - report = validator.report_findings(punx.finding.VALID_STATUS_LIST) + report = self.validator.report_findings(punx.finding.VALID_STATUS_LIST) #print('\n' + report + '\n') msg = 'NeXus default plot: /entry/data/data' self.assertFalse(report.find('no default plot: not a NeXus file') >= 0, msg) - report = validator.report_findings_summary().splitlines()[6] + report = self.validator.report_findings_summary().splitlines()[6] #print('\n' + report + '\n') msg = 'no ERRORs should be found' self.assertEqual(int(report.split()[1]), 0, msg) + def test_simple_no_NXdata(self): import punx.validate, punx.finding, punx.logs @@ -92,16 +97,16 @@ def test_simple_no_NXdata(self): hdf5root.close() punx.logs.ignore_logging() - validator = punx.validate.Data_File_Validator(self.testfile) - validator.validate() + self.validator = punx.validate.Data_File_Validator(self.testfile) + self.validator.validate() self.report = [] - report = validator.report_findings(punx.finding.VALID_STATUS_LIST) + report = self.validator.report_findings(punx.finding.VALID_STATUS_LIST) #print('\n' + report + '\n') msg = 'no NeXus default plot, no NXdata group, valid NeXus as of NIAC2016' self.assertFalse(report.find('no default plot: not a NeXus file') >= 0, msg) - report = validator.report_findings_summary().splitlines()[6] + report = self.validator.report_findings_summary().splitlines()[6] #print('\n' + report + '\n') msg = 'no ERRORs should be found' self.assertEqual(int(report.split()[1]), 0, msg)