How to use the oscpy.cli.__dump 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___dump(capsys):
    options = Mock()
    options.repeat = 2
    options.host = 'localhost'
    options.port = randint(60000, 65535)
    options.address = b'/test'
    options.safer = False
    options.encoding = None
    options.encoding_errors = 'strict'
    options.message = (1, 2, 3, 4, b"hello world")

    osc = __dump(options)
    out = capsys.readouterr().out
    assert out == ''

    send_message(
        options.address,
        options.message,
        options.host,
        options.port,
        safer=options.safer,
        encoding=options.encoding,
        encoding_errors=options.encoding_errors
    )

    sleep(0.1)
    out, err = capsys.readouterr()
    assert err == ''