コード例 #1
0
ファイル: test_process.py プロジェクト: anantvyas/aurora
def test_resolver_none_output():
  with temporary_dir() as td:
    taskpath = make_taskpath(td)
    r = LogDestinationResolver(taskpath, destination=LoggerDestination.NONE)
    stdout, stderr = r.get_handlers()
    assert type(stdout) == StreamHandler
    assert type(stderr) == StreamHandler
コード例 #2
0
def test_resolver_console_output():
  with temporary_dir() as td:
    taskpath = make_taskpath(td)
    r = LogDestinationResolver(taskpath, destination=LoggerDestination.CONSOLE)
    stdout, stderr, handlers_are_files = r.get_handlers()
    assert stdout == sys.stdout
    assert stderr == sys.stderr
    assert handlers_are_files
コード例 #3
0
def test_resolver_none_output():
  with temporary_dir() as td:
    taskpath = make_taskpath(td)
    r = LogDestinationResolver(taskpath, destination=LoggerDestination.NONE)
    stdout, stderr, handlers_are_files = r.get_handlers()
    assert type(stdout) == StreamHandler
    assert type(stderr) == StreamHandler
    assert not handlers_are_files
コード例 #4
0
ファイル: test_process.py プロジェクト: StephanErb/aurora
def test_resolver_console_output():
    with temporary_dir() as td:
        taskpath = make_taskpath(td)
        r = LogDestinationResolver(taskpath, destination=LoggerDestination.CONSOLE)
        stdout, stderr, handlers_are_files = r.get_handlers()
        assert stdout == sys.stdout
        assert stderr == sys.stderr
        assert handlers_are_files
コード例 #5
0
ファイル: test_process.py プロジェクト: anantvyas/aurora
def test_resolver_both_output():
  with temporary_dir() as td:
    taskpath = make_taskpath(td)
    r = LogDestinationResolver(taskpath, destination=LoggerDestination.BOTH)
    stdout, stderr = r.get_handlers()
    assert type(stdout) == TeeHandler
    assert type(stderr) == TeeHandler
    assert_log_file_exists(taskpath, 'stdout')
    assert_log_file_exists(taskpath, 'stderr')
コード例 #6
0
ファイル: test_process.py プロジェクト: anantvyas/aurora
def test_resolver_console_output():
  with temporary_dir() as td:
    taskpath = make_taskpath(td)
    r = LogDestinationResolver(taskpath, destination=LoggerDestination.CONSOLE)
    stdout, stderr = r.get_handlers()
    assert type(stdout) == StreamHandler
    assert type(stderr) == StreamHandler
    assert stdout._stream == sys.stdout
    assert stderr._stream == sys.stderr
コード例 #7
0
def test_resolver_both_output():
  with temporary_dir() as td:
    taskpath = make_taskpath(td)
    r = LogDestinationResolver(taskpath, destination=LoggerDestination.BOTH)
    stdout, stderr, handlers_are_files = r.get_handlers()
    assert type(stdout) == TeeHandler
    assert type(stderr) == TeeHandler
    assert not handlers_are_files
    assert_log_file_exists(taskpath, 'stdout')
    assert_log_file_exists(taskpath, 'stderr')
コード例 #8
0
ファイル: test_process.py プロジェクト: StephanErb/aurora
def test_resolver_file_output():
    with temporary_dir() as td:
        taskpath = make_taskpath(td)
        r = LogDestinationResolver(taskpath, destination=LoggerDestination.FILE)
        stdout, stderr, handlers_are_files = r.get_handlers()
        assert type(stdout) == file
        assert type(stderr) == file
        assert handlers_are_files
        assert_log_file_exists(taskpath, "stdout")
        assert_log_file_exists(taskpath, "stderr")
コード例 #9
0
ファイル: test_process.py プロジェクト: theevocater/aurora
def test_resolver_file_output():
    with temporary_dir() as td:
        taskpath = make_taskpath(td)
        r = LogDestinationResolver(taskpath,
                                   destination=LoggerDestination.FILE)
        stdout, stderr = r.get_handlers()
        assert type(stdout) == FileHandler
        assert type(stderr) == FileHandler
        assert_log_file_exists(taskpath, 'stdout')
        assert_log_file_exists(taskpath, 'stderr')
コード例 #10
0
ファイル: test_process.py プロジェクト: theevocater/aurora
def test_resolver_console_output():
    with temporary_dir() as td:
        taskpath = make_taskpath(td)
        r = LogDestinationResolver(taskpath,
                                   destination=LoggerDestination.CONSOLE)
        stdout, stderr = r.get_handlers()
        assert type(stdout) == StreamHandler
        assert type(stderr) == StreamHandler
        assert stdout._stream == sys.stdout
        assert stderr._stream == sys.stderr
コード例 #11
0
ファイル: test_process.py プロジェクト: anantvyas/aurora
def test_resolver_both_with_rotation_output():
  with temporary_dir() as td:
    taskpath = make_taskpath(td)
    r = LogDestinationResolver(taskpath, destination=LoggerDestination.BOTH,
                               mode=LoggerMode.ROTATE,
                               rotate_log_size=Amount(70, Data.BYTES),
                               rotate_log_backups=2)
    stdout, stderr = r.get_handlers()
    assert type(stdout) == TeeHandler
    assert type(stderr) == TeeHandler
    assert_log_file_exists(taskpath, 'stdout')
    assert_log_file_exists(taskpath, 'stderr')
コード例 #12
0
def test_resolver_both_with_rotation_output():
  with temporary_dir() as td:
    taskpath = make_taskpath(td)
    r = LogDestinationResolver(taskpath, destination=LoggerDestination.BOTH,
                               mode=LoggerMode.ROTATE,
                               rotate_log_size=Amount(70, Data.BYTES),
                               rotate_log_backups=2)
    stdout, stderr, handlers_are_files = r.get_handlers()
    assert type(stdout) == TeeHandler
    assert type(stderr) == TeeHandler
    assert not handlers_are_files
    assert_log_file_exists(taskpath, 'stdout')
    assert_log_file_exists(taskpath, 'stderr')