praekelt/vumi — pull request #573 by ashfall (2013-06-26 13:34:40+00:00)
Title: We need a USSD transport for MTN Rwanda

MTN Rwanda's USSD API is built on top of XML-RPC. We need a [Vumi Transport](https://github.com/praekelt/vumi/blob/develop/vumi/transports/base.py) that gives us an XML-RPC server implementation that answers to the calls from the client at MTN Rwanda:

The expected deliverable is a transport:

1. that accepts incoming USSD requests via XML-RPC calls from MTN Rwanda's servers.
2. that holds on to the sync HTTP request while waiting for a response from the async application backend, much like our [HTTP based transports](https://github.com/praekelt/vumi/blob/develop/vumi/transports/httprpc/httprpc.py) do.
3. whose tests that can be run with `trial` and which use our [TransportTestCase](https://github.com/praekelt/vumi/blob/develop/vumi/transports/tests/utils.py#L7) base class. This provides convenience methods for setting up & tearing down the worker and stubs out all of the AMQP machinery with a FakeAMQP implementation (compliments of @jerith).

General approach we take with testing this stuff is to fire up a separate service that mocks the remote side of the transport (in this case MTN Rwanda) which is used to make assertions on outbound calls and generate fake responses. See the [Apposit test case](https://github.com/praekelt/vumi/blob/develop/vumi/transports/apposit/tests/test_apposit.py#L23-L27) for an example of the service and [how it is used in a test](https://github.com/praekelt/vumi/blob/develop/vumi/transports/apposit/tests/test_apposit.py#L273).

In this case since it's plain XML-RPC it's fairly straight forward, the test can start up a transport instance and point an XML-RPC client at it.