]> Frank Brehm's Git Trees - pixelpark/puppet-tools.git/commitdiff
Adding test/test_02_errors.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 3 Feb 2023 16:47:35 +0000 (17:47 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 3 Feb 2023 16:47:35 +0000 (17:47 +0100)
test/test_02_errors.py [new file with mode: 0644]

diff --git a/test/test_02_errors.py b/test/test_02_errors.py
new file mode 100644 (file)
index 0000000..562d6bf
--- /dev/null
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+'''
+@author: Frank Brehm
+@contact: frank@brehm-online.com
+@copyright: © 2023 Frank Brehm, Digitas Pixelpark GmbH Berlin
+@license: GNU AGPL3
+@summary: test script (and module) for unit tests on error (exception) classes
+'''
+
+import os
+import sys
+import logging
+
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
+
+libdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'lib'))
+sys.path.insert(0, libdir)
+
+from general import DpxPuppetToolsTestcase, get_arg_verbose, init_root_logger
+
+LOG = logging.getLogger('test_errors')
+
+# =============================================================================
+class TestErrors(DpxPuppetToolsTestcase):
+
+    # -------------------------------------------------------------------------
+    def setUp(self):
+        pass
+
+    # -------------------------------------------------------------------------
+    def test_import(self):
+
+        LOG.info("Testing import of dpx_puppettools.errors ...")
+        import dpx_puppettools.errors
+        LOG.debug(
+            "Version of dpx_puppettools.errors: " + dpx_puppettools.errors.__version__)
+
+# =============================================================================
+if __name__ == '__main__':
+
+    verbose = get_arg_verbose()
+    if verbose is None:
+        verbose = 0
+    init_root_logger(verbose)
+
+    LOG.info("Starting tests ...")
+
+    suite = unittest.TestSuite()
+
+    suite.addTest(TestErrors('test_import', verbose))
+
+    runner = unittest.TextTestRunner(verbosity=verbose)
+
+    result = runner.run(suite)
+
+# =============================================================================
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4