Example #1
0
from pubres.cli_arguments import make_parser

p = make_parser()


def test_command_line():
    r = p.parse_args(
        ['--host', 'localhost', '--port', '5678', '--loglevel', 'ERROR'])
    assert r.host == 'localhost'
    assert r.port == 5678
    assert r.loglevel == 'ERROR'


def test_default_command_line():
    r = p.parse_args([])
    assert r.host == '127.0.0.1'
    assert r.port == 5555
    assert r.loglevel == 'INFO'
Example #2
0
from pubres.cli_arguments import make_parser


p = make_parser()


def test_command_line():
    r = p.parse_args(['--host', 'localhost', '--port', '5678', '--loglevel', 'ERROR'])
    assert r.host == 'localhost'
    assert r.port == 5678
    assert r.loglevel == 'ERROR'


def test_default_command_line():
    r = p.parse_args([])
    assert r.host == '127.0.0.1'
    assert r.port == 5555
    assert r.loglevel == 'INFO'
Example #3
0
def main():
    args = make_parser().parse_args()

    setup_logging(level=args.loglevel)

    pubres.Server(host=args.host, port=args.port).run_until_stop()