--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+'''
+@author: Frank Brehm
+@contact: frank.brehm@pixelpark.com
+@copyright: © 2022 by Frank Brehm, Berlin
+@license: GPL3
+@summary: test script (and module) for unit tests on mail config class
+'''
+
+import os
+import sys
+import logging
+
+from pathlib import Path
+
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+
+# from babel.dates import LOCALTZ
+
+libdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'lib'))
+sys.path.insert(0, libdir)
+
+from general import PpAdminToolsTestcase, get_arg_verbose, init_root_logger
+
+from fb_tools.common import pp, to_str, is_sequence
+
+LOG = logging.getLogger('test-mailcfg')
+
+
+# =============================================================================
+class TestMailConfig(PpAdminToolsTestcase):
+
+ # -------------------------------------------------------------------------
+ def setUp(self):
+
+ self.test_dir = Path(__file__).parent.resolve()
+ self.base_dir = self.test_dir.parent
+ self.test_cfg_dir = self.test_dir / 'test-mailconfig'
+ self._appname = 'test-mailcfg'
+
+ # -------------------------------------------------------------------------
+ def tearDown(self):
+
+ pass
+
+ # -------------------------------------------------------------------------
+ def test_import(self):
+
+ LOG.info("Testing import of pp_admintools.mail_config ...")
+ import pp_admintools.mail_config
+ LOG.debug(
+ "Version of pp_admintools.mail_config: " + pp_admintools.mail_config.__version__)
+
+ LOG.info("Testing import of MailConfigError from pp_admintools.mail_config ...")
+ from pp_admintools.mail_config import MailConfigError # noqa
+
+ LOG.info("Testing import of MailConfiguration from pp_admintools.mail_config ...")
+ from pp_admintools.mail_config import MailConfiguration # noqa
+
+ # -------------------------------------------------------------------------
+ def test_object(self):
+
+ LOG.info("Testing init of a MailConfiguration object.")
+
+ from pp_admintools.mail_config import MailConfiguration
+
+ cfg = MailConfiguration(
+ appname=self.appname,
+ config_dir='test', additional_stems='test',
+ verbose=self.verbose,
+ )
+ LOG.debug("MailConfiguration %%r: %r", cfg)
+ LOG.debug("MailConfiguration %%s: %s", str(cfg))
+
+
+# =============================================================================
+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(TestMailConfig('test_import', verbose))
+ suite.addTest(TestMailConfig('test_object', verbose))
+
+ runner = unittest.TextTestRunner(verbosity=verbose)
+
+ result = runner.run(suite)
+
+
+# =============================================================================
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4