1# Copyright (c) Twisted Matrix Laboratories.
2# See LICENSE for details.
3
4"""
5Helpers for testing AMP protocols.
6"""
7
8from twisted.protocols import amp
9
10def callResponder(__locator, __command, **args):
11    """
12    Call an I{AMP} responder on a given locator,
13
14    @param __locator: Locator on which to find responder
15    @type __locator: L{amp.IResponderLocator}
16    @param __command: Command to run.
17    @type __command: L{amp.Command}
18    """
19    box = __command.makeArguments(args, None)
20    d = __locator.locateResponder(__command.commandName)(box)
21    d.addCallback(amp._stringsToObjects, __command.response, None)
22    return d
23