#!/usr/bin/python
# -*- coding: utf-8 -*-


import unittest
import run_tests # set sys.path

import logging
from kobo.log import *




class TestLog(unittest.TestCase):
    def setUp(self):
        self.logger = logging.getLogger("TestLogger")

    def test_verbose_hack(self):
        self.logger.verbose("foo")
        logging.verbose("foo")
        self.assertEqual(logging.VERBOSE, 15)
        self.assertTrue("VERBOSE" in logging._levelNames)
        self.assertEqual(logging._levelNames[15], "VERBOSE")


if __name__ == '__main__':
    unittest.main()

#!/usr/bin/python
# -*- coding: utf-8 -*-


import unittest
import run_tests # set sys.path
import six

import logging
from kobo.log import *




class TestLog(unittest.TestCase):
    def setUp(self):
        self.logger = logging.getLogger("TestLogger")

    def test_verbose_hack(self):
        self.logger.verbose("foo")
        logging.verbose("foo")
        self.assertEqual(logging.VERBOSE, 15)
        if six.PY2:
            # There is no _levelNames attribute in Python 3
            self.assertTrue("VERBOSE" in logging._levelNames)
        self.assertEqual(logging.getLevelName(15), "VERBOSE")


if __name__ == '__main__':
    unittest.main()

Fix missing attribute logging._levelNames