'L{Factory.forProtocol} constructs a Factory, passing along any
additional arguments, and sets its C{protocol} attribute to the given
Protocol subclass.'

def test_forProtocol(self):

    class ArgTakingFactory(Factory, ):
        def __init__(self, *args, **kwargs):
            (self.args, self.kwargs) = (args, kwargs)
    factory = ArgTakingFactory.forProtocol(Protocol, 1, 2, foo=12)
    self.assertEqual(factory.protocol, Protocol)
    self.assertEqual(factory.args, (1, 2))
    self.assertEqual(factory.kwargs, {'foo': 12})
