Ejemplo n.º 1
0
def test_error(exception, capsys):
    with patch('nameko.cli.run.main') as run:
        run.side_effect = exception('boom')
        main()
    out, _ = capsys.readouterr()
    assert out.strip() == 'Error: boom'
Ejemplo n.º 2
0
def test_run():
    with patch('nameko.cli.run.main') as run:
        main()
    assert run.call_count == 1
    (args, ), _ = run.call_args
    assert args.broker == 'my_broker'
Ejemplo n.º 3
0
import sys
from nameko.cli.main import main

main()
Ejemplo n.º 4
0
def test_error(exception, capsys):
    with patch('nameko.cli.run.main') as run:
        run.side_effect = exception('boom')
        main()
    out, _ = capsys.readouterr()
    assert out.strip() == 'Error: boom'
Ejemplo n.º 5
0
def test_run():
    with patch('nameko.cli.run.main') as run:
        main()
    assert run.call_count == 1
    (args,), _ = run.call_args
    assert args.broker == 'my_broker'
Ejemplo n.º 6
0
# Exact code from nameko pip shortcut
import re
import sys
from nameko.cli.main import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())