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

index 1f0e7c95f32c2e58d1c2ce87e811e3530925d1b7..94fc9b885eef45eded7631f8b638cceffed7d075 100644 (file)
@@ -4,7 +4,7 @@
 @author: Frank Brehm
 @contact: frank.brehm@pixelpark.com
 @copyright: © 2023 Frank Brehm, Digitas Pixelpark GmbH Berlin
-@license: LGPL3
+@license: GNU AGPL3
 @summary: general used functions an objects used for unit tests on
           the dpx_puppettools
 """
diff --git a/test/test_00_general.py b/test/test_00_general.py
new file mode 100755 (executable)
index 0000000..22aa9b7
--- /dev/null
@@ -0,0 +1,64 @@
+#!/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 the very basic class
+'''
+
+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_global')
+
+
+# =============================================================================
+class TestGlobal(DpxPuppetToolsTestcase):
+
+    # -------------------------------------------------------------------------
+    def setUp(self):
+        pass
+
+    # -------------------------------------------------------------------------
+    def test_import(self):
+
+        LOG.info("Testing import of dpx_puppettools ...")
+        import dpx_puppettools
+        LOG.debug(
+            "Version of dpx_puppettools: " + dpx_puppettools.__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(TestGlobal('test_import', verbose))
+
+    runner = unittest.TextTestRunner(verbosity=verbose)
+
+    result = runner.run(suite)
+
+# =============================================================================
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4