示例#1
0
def test_debug_mode_trace_level(show_image):
    remove_dirs('log/')
    log.set_mode(log.Mode.DEBUG)
    log.set_level(log.Level.TRACE)
    show_image.return_value = ord("y")
    log_all_level(cv2.imread("tests/data/orange.png"))
    assert os.path.exists('log/cvlog.html') is False
示例#2
0
def test_log_mode_info_level():
    remove_dirs('log/')
    log.set_mode(log.Mode.LOG)
    log.set_level(log.Level.INFO)
    log_all_level(cv2.imread("tests/data/orange.png"))
    logitem = get_html('log/cvlog.html').select('.log-list .log-item')
    assert len(logitem) == 2
    level_info_tag = logitem[0].select('.level')[0]
    assert level_info_tag.get_text() == 'INFO'
    assert level_info_tag['class'] == ['level', 'info']
    level_error_tag = logitem[1].select('.level')[0]
    assert level_error_tag.get_text() == 'ERROR'
    assert level_error_tag['class'] == ['level', 'error']