Skip to content

Commit

Permalink
update test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Jan 12, 2017
1 parent dad09d5 commit dfb3c0b
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 11 deletions.
2 changes: 2 additions & 0 deletions hpsspy/test/hpsspy_test_suite.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
hpsspy.test.hpsspy_test_suite
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
17 changes: 15 additions & 2 deletions hpsspy/test/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@


class TestData(unittest.TestCase):
"""Check integrity of data files.
"""

@classmethod
def setUpClass(cls):
pass

@classmethod
def tearDownClass(cls):
pass

def setUp(self):
pass
Expand Down Expand Up @@ -53,5 +63,8 @@ def test_desi(self):
self.check_json('desi.json', releases)


if __name__ == '__main__':
unittest.main()
def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
15 changes: 13 additions & 2 deletions hpsspy/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ class TestOs(unittest.TestCase):
"""Test the functions in the os subpackage.
"""

@classmethod
def setUpClass(cls):
pass

@classmethod
def tearDownClass(cls):
pass

def setUp(self):
# Store the original value of env variables, if present.
# self.env = {'TMPDIR': None, 'HPSS_DIR': None}
Expand All @@ -41,5 +49,8 @@ def tearDown(self):
pass


if __name__ == '__main__':
unittest.main()
def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
15 changes: 13 additions & 2 deletions hpsspy/test/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ class TestScan(unittest.TestCase):
"""Test the functions in the scan subpackage.
"""

@classmethod
def setUpClass(cls):
pass

@classmethod
def tearDownClass(cls):
pass

def setUp(self):
# Store the original value of env variables, if present.
# self.env = {'TMPDIR': None, 'HPSS_DIR': None}
Expand All @@ -40,5 +48,8 @@ def tearDown(self):
pass


if __name__ == '__main__':
unittest.main()
def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
7 changes: 5 additions & 2 deletions hpsspy/test/test_top_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ def test_version(self):
self.assertRegexpMatches(theVersion, self.versionre)


if __name__ == '__main__':
unittest.main()
def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
19 changes: 16 additions & 3 deletions hpsspy/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ class TestUtil(unittest.TestCase):
"""Test the functions in the util subpackage.
"""

@classmethod
def setUpClass(cls):
pass

@classmethod
def tearDownClass(cls):
pass

def setUp(self):
self.PY3 = sys.version_info[0] > 2
# Store the original value of env variables, if present.
Expand Down Expand Up @@ -62,10 +70,11 @@ def test_HpssFile(self):
links = ('/nersc/projects/boss', '/nersc/projects/cosmo',
'/nersc/projects/desi', None)
modes = (511, 511, 511, 1517)
this_year = datetime.datetime.now().year
mtimes = (datetime.datetime(2008, 4, 3, 0, 0, 0),
datetime.datetime(2014, 8, 22, 0, 0, 0),
datetime.datetime(2013, 12, 16, 0, 0, 0),
datetime.datetime(2016, 4, 4, 13, 14, 0))
datetime.datetime(this_year, 4, 4, 13, 14, 0))
data = (('l', 'rwxrwxrwx', '1', 'bweaver', 'bweaver',
'20', 'Apr', '3', '2008', 'boss@ -> /nersc/projects/boss'),
('l', 'rwxrwxrwx', '1', 'bweaver', 'bweaver',
Expand Down Expand Up @@ -144,5 +153,9 @@ def test_htar(self):
self.assertEqual(err.strip(), '')
self.remove_bin('htar')

if __name__ == '__main__':
unittest.main()

def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)

0 comments on commit dfb3c0b

Please sign in to comment.