Esempio n. 1
0
    def test_config(self):
        log = Logger()

        log.config(indent=2)
        assert log._indent is 2

        log.config(verbose=True, quiet=True)
        assert log._enable_verbose is True
        assert log._enable_quiet is True
Esempio n. 2
0
    def test_verbose(self):
        log = Logger()
        assert log._is_verbose is False
        assert log.verbose._is_verbose is True

        log.verbose.start('no start')
        log.verbose.end('no end')
Esempio n. 3
0
    def test_config(self):
        log = Logger()

        log.config(indent=2)
        assert log._indent is 2

        log.config(verbose=True, quiet=True)
        assert log._enable_verbose is True
        assert log._enable_quiet is True
Esempio n. 4
0
    def test_log(self):
        log = Logger()
        log.debug("debug message")
        log.info("info message")
        log.warn("warn message")
        log.error("error message")

        log.verbose.info("verbose info message")
        log.config(verbose=True)
        log.verbose.info("verbose info message")

        log.start("start message")
        log.info("info message")
        log.end("end message")

        log.config(quiet=True)
        log.debug("debug message")
        log.info("info message")

        log.start("start message")
        log.end()
Esempio n. 5
0
 def test_message(self):
     log = Logger()
     assert log.message("unknown", "foo", "bar") == "foo bar"
Esempio n. 6
0
    def test_log(self):
        log = Logger()
        log.debug('debug message')
        log.info('info message')
        log.warn('warn message')
        log.error('error message')

        log.verbose.info('verbose info message')
        log.config(verbose=True)
        log.verbose.info('verbose info message')

        log.start('start message')
        log.info('info message')
        log.end('end message')

        log.config(quiet=True)
        log.debug('debug message')
        log.info('info message')

        log.start('start message')
        log.end()
Esempio n. 7
0
 def test_message(self):
     log = Logger()
     assert log.message('unknown', 'foo', 'bar') == 'foo bar'