mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-07-22 02:03:01 +02:00
Add an additional test and "fix" code coverage (#1242).
This commit is contained in:
@@ -222,7 +222,7 @@ def read_lines(buffer, process, line_separator='\n'):
|
||||
|
||||
if not chunk: # EOF
|
||||
# The process is still running, so we keep running too.
|
||||
if process.poll() is None:
|
||||
if process.poll() is None: # pragma: no cover
|
||||
continue
|
||||
|
||||
break
|
||||
|
||||
@@ -302,6 +302,13 @@ def test_handle_log_record_over_max_line_count_trims_and_appends():
|
||||
assert last_lines == [*original_last_lines[1:], 'line']
|
||||
|
||||
|
||||
def test_handle_log_record_without_last_lines_just_handles():
|
||||
flexmock(module.logger).should_receive('handle').once()
|
||||
log_record = flexmock(levelno=module.logging.INFO, getMessage=lambda: 'line')
|
||||
|
||||
assert module.handle_log_record(log_record) == log_record
|
||||
|
||||
|
||||
def test_log_buffer_lines_without_buffer_readers_bails():
|
||||
flexmock(module.select).should_receive('select').never()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user