]> Frank Brehm's Git Trees - pixelpark/trace-maillog.git/commitdiff
Adding test/test_any_uncompress.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 11 May 2017 12:00:31 +0000 (14:00 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 11 May 2017 12:00:31 +0000 (14:00 +0200)
test/test_any_uncompress.py [new file with mode: 0755]

diff --git a/test/test_any_uncompress.py b/test/test_any_uncompress.py
new file mode 100755 (executable)
index 0000000..afa77f7
--- /dev/null
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import os, sys
+# for output which reports a local time
+os.environ['TZ'] = 'GMT'
+import shutil
+import os.path
+import re
+
+import logging
+import locale
+
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
+
+import six
+
+from pb_base.common import pp
+from pb_base.common import bytes2human
+
+libdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'lib'))
+sys.path.insert(0, libdir)
+
+from general import LogtraceTestcase, get_arg_verbose, init_root_logger
+
+locale.setlocale(locale.LC_ALL, '')
+
+APPNAME = 'test_any_uncompress'
+
+LOG = logging.getLogger(APPNAME)
+
+
+# =============================================================================
+class TestAnyUncompress(LogtraceTestcase):
+
+    # -------------------------------------------------------------------------
+    def setUp(self):
+        self.appname = APPNAME
+        self.testdata_dir = os.path.join(os.path.dirname(__file__), 'testfiles-uncompress')
+
+    # -------------------------------------------------------------------------
+    def tearDown(self):
+        pass
+
+    # -------------------------------------------------------------------------
+    def test_import(self):
+
+        LOG.info("Testing import of trace_maillog.any_uncompress_file ...")
+        import trace_maillog.any_uncompress_file                        # noqa
+
+        LOG.info("Testing import of AnyUmpressFile from trace_maillog.any_uncompress_file ...")
+        from trace_maillog.any_uncompress_file import AnyUmpressFile    # noqa
+
+
+# =============================================================================
+
+if __name__ == '__main__':
+
+
+    verbose = get_arg_verbose()
+    if verbose is None:
+        verbose = 0
+    init_root_logger(verbose)
+
+    LOG.info("Starting tests ...")
+
+    loader = unittest.TestLoader()
+    suite = unittest.TestSuite()
+
+    suite.addTest(TestAnyUncompress('test_import', verbose))
+
+    runner = unittest.TextTestRunner(verbosity=verbose)
+
+    result = runner.run(suite)
+
+
+# =============================================================================
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+