# Path: hftools/testing/common.py
# class TestCase(unittest.TestCase):
#     def assertAllclose(self, a, b, rtol=1e-05, atol=1e-08, msg=None):
#         a = np.asanyarray(a)
#         b = np.asanyarray(b)
#         if msg is None:
#             msg = "a (%s) not close to b (%s)" % (a, b)
#         self.assertTrue(np.allclose(a, b, rtol, atol), msg)
# 
#     def assertIsNotInstance(self, obj, cls):
#         self.assertFalse(isinstance(obj, cls))
# 
#     def assertIsInstance(self, obj, cls, msg=None):
#         """Same as self.assertTrue(isinstance(obj, cls)), with a nicer
#         default message."""
#         if not isinstance(obj, cls):
#             arg = (unittest.case.safe_repr(obj), cls)
#             standardMsg = '%s is not an instance of %r' % arg
#             self.fail(self._formatMessage(msg, standardMsg))
# 
#     def assertHFToolsWarning(self, funk, *k, **kw):
#         warnings.resetwarnings()
#         warnings.simplefilter("error", HFToolsWarning)
#         self.assertRaises(HFToolsWarning, funk, *k, **kw)
#         warnings.simplefilter("ignore", HFToolsWarning)
# 
#     def assertHFToolsDeprecationWarning(self, funk, *k, **kw):
#         warnings.resetwarnings()
#         warnings.simplefilter("error", HFToolsDeprecationWarning)
#         self.assertRaises(HFToolsDeprecationWarning, funk, *k, **kw)
#         warnings.simplefilter("ignore", HFToolsDeprecationWarning)
# 
# def make_load_tests(module):
#     """Add doctests to tests for module
# 
#     usage::
#         load_tests = make_load_tests(module)
#     """
#     warnings.simplefilter("error", HFToolsWarning)
#     warnings.simplefilter("error", HFToolsDeprecationWarning)
# #    warnings.simplefilter("error", DeprecationWarning)
# 
#     def load_tests(loader, standard_tests, pattern):
#         suite = unittest.TestSuite()
#         suite.addTests(standard_tests)
#         DocTests = doctest.DocTestSuite(module)
#         suite.addTests(DocTests)
#         return suite
#     return load_tests


import datetime as datetimemodule
import os
import pdb
import shutil
import numpy as np
import hftools.utils as utils
from hftools.testing import TestCase, make_load_tests
    def test_2(self):
        self.assertTrue(os.path.isdir(os.path.join(self.base, "aa")))

    def test_3(self):
        self.assertTrue(os.path.isdir(os.path.join(self.base, "bb5")))

    def test_4(self):
        self.assertTrue(os.path.isdir(os.path.join(self.base, "bb11")))

    def test_5(self):  # ensure present dirs does not crash make_dirs
        utils.make_dirs(self.base, "bb11")
        self.assertTrue(os.path.isdir(os.path.join(self.base, "bb11")))

    def test_glob_1(self):
        f = utils.glob(os.path.join(self.base, "*"))
        f = [os.path.split(x)[1] for x in f]
        self.assertEqual(f, ["aa", "bb5", "bb11"])


class Test_isnumber(TestCase):
    def test_isnumber_int(self):
        self.assertTrue(utils.isnumber(19))

    def test_isnumber_float(self):
        self.assertTrue(utils.isnumber(19.))

    def test_isnumber_cplx(self):
        self.assertTrue(utils.isnumber(19. + 1j))



# Path: hftools/testing/common.py
# class TestCase(unittest.TestCase):
#     def assertAllclose(self, a, b, rtol=1e-05, atol=1e-08, msg=None):
#         a = np.asanyarray(a)
#         b = np.asanyarray(b)
#         if msg is None:
#             msg = "a (%s) not close to b (%s)" % (a, b)
#         self.assertTrue(np.allclose(a, b, rtol, atol), msg)
# 
#     def assertIsNotInstance(self, obj, cls):
#         self.assertFalse(isinstance(obj, cls))
# 
#     def assertIsInstance(self, obj, cls, msg=None):
#         """Same as self.assertTrue(isinstance(obj, cls)), with a nicer
#         default message."""
#         if not isinstance(obj, cls):
#             arg = (unittest.case.safe_repr(obj), cls)
#             standardMsg = '%s is not an instance of %r' % arg
#             self.fail(self._formatMessage(msg, standardMsg))
# 
#     def assertHFToolsWarning(self, funk, *k, **kw):
#         warnings.resetwarnings()
#         warnings.simplefilter("error", HFToolsWarning)
#         self.assertRaises(HFToolsWarning, funk, *k, **kw)
#         warnings.simplefilter("ignore", HFToolsWarning)
# 
#     def assertHFToolsDeprecationWarning(self, funk, *k, **kw):
#         warnings.resetwarnings()
#         warnings.simplefilter("error", HFToolsDeprecationWarning)
#         self.assertRaises(HFToolsDeprecationWarning, funk, *k, **kw)
#         warnings.simplefilter("ignore", HFToolsDeprecationWarning)
# 
# def make_load_tests(module):
#     """Add doctests to tests for module
# 
#     usage::
#         load_tests = make_load_tests(module)
#     """
#     warnings.simplefilter("error", HFToolsWarning)
#     warnings.simplefilter("error", HFToolsDeprecationWarning)
# #    warnings.simplefilter("error", DeprecationWarning)
# 
#     def load_tests(loader, standard_tests, pattern):
#         suite = unittest.TestSuite()
#         suite.addTests(standard_tests)
#         DocTests = doctest.DocTestSuite(module)
#         suite.addTests(DocTests)
#         return suite
#     return load_tests


# Path: hftools/tests/test_utils.py
import datetime as datetimemodule
import os
import pdb
import shutil
import numpy as np
import hftools.utils as utils
from hftools.testing import TestCase, make_load_tests

    def test_2(self):
        self.assertTrue(os.path.isdir(os.path.join(self.base, "aa")))

    def test_3(self):
        self.assertTrue(os.path.isdir(os.path.join(self.base, "bb5")))

    def test_4(self):
        self.assertTrue(os.path.isdir(os.path.join(self.base, "bb11")))

    def test_5(self):  # ensure present dirs does not crash make_dirs
        utils.make_dirs(self.base, "bb11")
        self.assertTrue(os.path.isdir(os.path.join(self.base, "bb11")))

    def test_glob_1(self):
        f = utils.glob(os.path.join(self.base, "*"))
        f = [os.path.split(x)[1] for x in f]
        self.assertEqual(f, ["aa", "bb5", "bb11"])


class Test_isnumber(TestCase):
    def test_isnumber_int(self):
        self.assertTrue(utils.isnumber(19))

    def test_isnumber_float(self):
        self.assertTrue(utils.isnumber(19.))

    def test_isnumber_cplx(self):
        self.assertTrue(utils.isnumber(19. + 1j))



class Test(TestCase):