Exemplo n.º 1
0
def test_record():
    logger = StdoutLogger(buffer_length=1)
    logger.enable()
    logger.record(['test'])
    assert logger._buffer[0] == 'Record: test'
Exemplo n.º 2
0
def test_enable():
    logger = StdoutLogger(buffer_length=1)
    logger.enable()
    assert logger.is_enabled()
    logger.record(['test'])
    assert len(logger._buffer) == 1
Exemplo n.º 3
0
def test_disable():
    logger = StdoutLogger()
    logger.disable()
    assert not logger.is_enabled()
    logger.record(['test'])
    assert len(logger._buffer) == 0
def test_record():
    logger = StdoutLogger(buffer_length=1)
    logger.open()

    logger.record(['test'], timestamp=5.0)
    assert logger._buffer[0] == 'Record 5.0: test'