Пример #1
0
def test_invalid_port():
    argv = make_argv(['--port', 'broken'])
    with pytest.raises(SystemExit):
        server.parse(argv)
Пример #2
0
def test_port_default():
    argv = make_argv()
    args = server.parse(argv)
    assert args.port == 8000
Пример #3
0
def test_port():
    argv = make_argv(['--port', '8080'])
    args = server.parse(argv)
    assert args.port == 8080
Пример #4
0
def test_listen():
    argv = make_argv(['--listen', '0.0.0.0'])
    args = server.parse(argv)
    assert args.listen == '0.0.0.0'
Пример #5
0
def test_listen_default():
    argv = make_argv()
    args = server.parse(argv)
    assert args.listen == 'localhost'
Пример #6
0
def test_invalid_port():
    argv = make_argv(["--port", "broken"])
    with pytest.raises(SystemExit):
        server.parse(argv)
Пример #7
0
def test_port():
    argv = make_argv(["--port", "8080"])
    args = server.parse(argv)
    assert args.port == 8080
Пример #8
0
def test_listen():
    argv = make_argv(["--listen", "0.0.0.0"])
    args = server.parse(argv)
    assert args.listen == "0.0.0.0"