From 22511ac96415485cb1463a3b23922937684a8305 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 11 May 2017 14:00:31 +0200 Subject: [PATCH] Adding test/test_any_uncompress.py --- test/test_any_uncompress.py | 83 +++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100755 test/test_any_uncompress.py diff --git a/test/test_any_uncompress.py b/test/test_any_uncompress.py new file mode 100755 index 0000000..afa77f7 --- /dev/null +++ b/test/test_any_uncompress.py @@ -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 + -- 2.39.5