Ejemplo n.º 1
0
def test_gcdt_formatter_warning(capsys):
    rec = LogRecord('gcdt.kumo_main', logging.WARNING,
                    './test_gcdt_logging.py', 26, 'warning message', None,
                    None)

    assert GcdtFormatter().format(rec) == \
           Fore.YELLOW + 'WARNING: warning message' + Fore.RESET
Ejemplo n.º 2
0
def test_gcdt_formatter_debug(capsys):
    rec = logging.LogRecord('gcdt.kumo_main', logging.DEBUG,
                            './test_gcdt_logging.py', 26, 'debug message',
                            None, None)

    assert GcdtFormatter().format(
        rec) == 'DEBUG: test_gcdt_logging: 26: debug message'
Ejemplo n.º 3
0
def test_gcdt_formatter_info(capsys):
    rec = LogRecord('gcdt.kumo_main', logging.INFO, './test_gcdt_logging.py',
                    26, 'info message', None, None)

    assert GcdtFormatter().format(rec) == 'info message'
Ejemplo n.º 4
0
def test_gcdt_formatter_error(capsys):
    rec = LogRecord('gcdt.kumo_main', logging.ERROR, './test_gcdt_logging.py',
                    26, 'error message', None, None)

    assert GcdtFormatter().format(rec) == \
           Fore.RED + 'ERROR: error message' + Fore.RESET