diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/logs.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/core/logs.py b/tests/core/logs.py new file mode 100644 index 0000000..96be519 --- /dev/null +++ b/tests/core/logs.py @@ -0,0 +1,34 @@ +#!/usr/bin/python3-dbg +# -*- coding: utf-8 -*- + + +# Tests validant le bon calcul d'empreintes. + + +from chrysacase import ChrysalideTestCase +from pychrysalide.core import logs + + +class TestCoreLogs(ChrysalideTestCase): + """TestCase for analysis.core.logs.""" + + def testDefaultLevel(self): + """Ensure all messages are hidden by default.""" + + self.assertEqual(logs.get_verbosity(), logs.LMT_COUNT) + + + def testWrongLevel(self): + """Verify the type of level when defining new verbosity.""" + + with self.assertRaisesRegex(Exception, 'argument 1 must be int, not str'): + + logs.set_verbosity('XXX') + + + def testWrongMessage(self): + """Check for unhandled message level.""" + + with self.assertRaisesRegex(Exception, 'Invalid type of message'): + + logs.log_message(logs.LMT_COUNT, 'Message') |