How to use the oscpy.cli._send function in oscpy

To help you get started, we’ve selected a few oscpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kivy / oscpy / tests / test_cli.py View on Github external
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