]> Frank Brehm's Git Trees - pixelpark/puppet-tools.git/commitdiff
Adding test for base app class
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 6 Feb 2023 09:17:36 +0000 (10:17 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 6 Feb 2023 09:17:36 +0000 (10:17 +0100)
test/test_05_base_app.py [new file with mode: 0755]

diff --git a/test/test_05_base_app.py b/test/test_05_base_app.py
new file mode 100755 (executable)
index 0000000..dc7cc08
--- /dev/null
@@ -0,0 +1,63 @@
+#!/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 base application 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_base_app')
+
+# =============================================================================
+class TestBaseApp(DpxPuppetToolsTestcase):
+
+    # -------------------------------------------------------------------------
+    def setUp(self):
+        pass
+
+    # -------------------------------------------------------------------------
+    def test_import(self):
+
+        LOG.info("Testing import of dpx_puppettools.app ...")
+        import dpx_puppettools.app
+        LOG.debug(
+            "Version of dpx_puppettools.app: " + dpx_puppettools.app.__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(TestBaseApp('test_import', verbose))
+
+    runner = unittest.TextTestRunner(verbosity=verbose)
+
+    result = runner.run(suite)
+
+# =============================================================================
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4