Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test__send(capsys):
options = Mock()
options.repeat = 2
options.host = 'localhost'
options.port = 12345
options.address = '/test'
options.safer = False
options.encoding = 'utf8'
options.encoding_errors = 'strict'
options.message = (1, 2, 3, 4, b"hello world")
_send(options)
captured = capsys.readouterr()
out = captured.out
assert out.startswith(dedent(
'''
Stats:
calls: 2
bytes: 88
params: 10
types:
'''
).lstrip())
assert ' i: 8' in out
assert ' s: 2' in out