Skip to content

Commit

Permalink
refs #50 Py2 & Py3, Windows, passes all unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Dec 7, 2016
1 parent f60fba0 commit 336d1b1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/punx/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.2
0.1.3
21 changes: 13 additions & 8 deletions tests/validate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 336d1b1

Please sign in to comment.