示例#1
0
def test_coerce_to_rpc():
    r = coerce_to_rpc(('127.0.0.1', 8000))
    assert (r.ip, r.port) == ('127.0.0.1', 8000)
    r = coerce_to_rpc('127.0.0.1:8000')
    assert (r.ip, r.port) == ('127.0.0.1', 8000)
    r = coerce_to_rpc('foo:bar:8000')
    assert (r.ip, r.port) == ('foo:bar', 8000)
示例#2
0
def test_coerce_to_rpc():
    with coerce_to_rpc(('127.0.0.1', 8000)) as r:
        assert (r.ip, r.port) == ('127.0.0.1', 8000)
    with coerce_to_rpc('127.0.0.1:8000') as r:
        assert (r.ip, r.port) == ('127.0.0.1', 8000)
    with coerce_to_rpc('foo:bar:8000') as r:
        assert (r.ip, r.port) == ('foo:bar', 8000)
示例#3
0
def test_coerce_to_rpc():
    r = coerce_to_rpc(('127.0.0.1', 8000))
    assert (r.ip, r.port) == ('127.0.0.1', 8000)
    r = coerce_to_rpc('127.0.0.1:8000')
    assert (r.ip, r.port) == ('127.0.0.1', 8000)