Exemplo n.º 1
0
def test_parse_options_allowedip():
    options = qserve.parse_options(["-a", "127.0.0.1", "-a", "192.168.10.210"])
    assert options == defopts(allowed_ips=set(["127.0.0.1", "192.168.10.210"]))
Exemplo n.º 2
0
def test_parse_options_datadir():
    options = qserve.parse_options(["-d", "/tmp/foo"])
    assert options == defopts(datadir="/tmp/foo")
Exemplo n.º 3
0
def test_parse_options_port():
    options = qserve.parse_options(["-p", "8000"])
    assert options == defopts(port=8000)

    options = qserve.parse_options(["--port", "8000"])
    assert options == defopts(port=8000)
Exemplo n.º 4
0
def test_parse_options_interface():
    options = qserve.parse_options(["-i", "127.0.0.1"])
    assert options == defopts(interface="127.0.0.1")

    options = qserve.parse_options(["--interface", "127.0.0.1"])
    assert options == defopts(interface="127.0.0.1")
Exemplo n.º 5
0
def test_parse_options_default():
    options = qserve.parse_options([])
    assert options == defopts()