Commit ba60d224 authored by Brian May's avatar Brian May

Add another test.

parent 3db38c99
...@@ -11,6 +11,7 @@ import sshuttle.helpers ...@@ -11,6 +11,7 @@ import sshuttle.helpers
@patch('sshuttle.helpers.sys.stderr') @patch('sshuttle.helpers.sys.stderr')
def test_log(mock_stderr, mock_stdout): def test_log(mock_stderr, mock_stdout):
sshuttle.helpers.log("message") sshuttle.helpers.log("message")
sshuttle.helpers.log("abc")
sshuttle.helpers.log("message 1\n") sshuttle.helpers.log("message 1\n")
sshuttle.helpers.log("message 2\nline2\nline3\n") sshuttle.helpers.log("message 2\nline2\nline3\n")
sshuttle.helpers.log("message 3\nline2\nline3") sshuttle.helpers.log("message 3\nline2\nline3")
...@@ -19,10 +20,13 @@ def test_log(mock_stderr, mock_stdout): ...@@ -19,10 +20,13 @@ def test_log(mock_stderr, mock_stdout):
call.flush(), call.flush(),
call.flush(), call.flush(),
call.flush(), call.flush(),
call.flush(),
] ]
assert mock_stderr.mock_calls == [ assert mock_stderr.mock_calls == [
call.write('prefix: message'), call.write('prefix: message'),
call.flush(), call.flush(),
call.write('prefix: abc'),
call.flush(),
call.write('prefix: message 1\n'), call.write('prefix: message 1\n'),
call.flush(), call.flush(),
call.write('prefix: message 2\n'), call.write('prefix: message 2\n'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment