def test_typeFromPlugin(self):
"""
L{endpoints.clientFromString} looks up plugins of type
L{IStreamClientEndpoint} and constructs endpoints from them.
"""
addFakePlugin(self)
notAReactor = object()
clientEndpoint = endpoints.clientFromString(
notAReactor, "crfake:alpha:beta:cee=dee:num=1")
from twisted.plugins.fakeendpoint import fakeClientWithReactor
self.assertIs(clientEndpoint.parser, fakeClientWithReactor)
self.assertEqual(clientEndpoint.args, (notAReactor, 'alpha', 'beta'))
self.assertEqual(clientEndpoint.kwargs, dict(cee='dee', num='1'))
评论列表
文章目录