From a147af0a18a7f5dd1ad35f9fd34547d1fea4751e Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 3 Feb 2023 17:50:44 +0100 Subject: [PATCH] Adding test to test/test_02_errors.py --- test/test_02_errors.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) mode change 100644 => 100755 test/test_02_errors.py diff --git a/test/test_02_errors.py b/test/test_02_errors.py old mode 100644 new mode 100755 index 562d6bf..c952a60 --- a/test/test_02_errors.py +++ b/test/test_02_errors.py @@ -38,6 +38,18 @@ class TestErrors(DpxPuppetToolsTestcase): import dpx_puppettools.errors LOG.debug( "Version of dpx_puppettools.errors: " + dpx_puppettools.errors.__version__) + # ------------------------------------------------------------------------- + def test_pt_error(self): + + LOG.info("Test raising a PuppetToolsError exception ...") + + from dpx_puppettools.errors import PuppetToolsError + + with self.assertRaises(PuppetToolsError) as cm: + raise PuppetToolsError("Bla blub") + e = cm.exception + LOG.debug("%s raised: %s", e.__class__.__name__, e) + # ============================================================================= if __name__ == '__main__': @@ -52,6 +64,7 @@ if __name__ == '__main__': suite = unittest.TestSuite() suite.addTest(TestErrors('test_import', verbose)) + suite.addTest(TestErrors('test_pt_error', verbose)) runner = unittest.TextTestRunner(verbosity=verbose) -- 2.39.5