def test_tcpPortPositionalArg(self):
"""
When passed a TCP strports description specifying port as a positional
argument, L{endpoints.clientFromString} returns a L{TCP4ClientEndpoint}
instance initialized with the values from the string.
"""
reactor = object()
client = endpoints.clientFromString(
reactor,
"tcp:host=example.com:1234:timeout=7:bindAddress=10.0.0.2")
self.assertEqual(client._host, "example.com")
self.assertEqual(client._port, 1234)
评论列表
文章目录