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)
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)
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)