@@ -0,0 +1,1328 @@
+%22%22%22Tests from vumi.middleware.address_translator.%22%22%22%0A%0Afrom twisted.trial.unittest import TestCase%0A%0Afrom vumi.middleware.address_translator import AddressTranslationMiddleware%0A%0A%0Aclass AddressTranslationMiddlewareTestCase(TestCase):%0A%0A    def mk_addr_trans(self, outbound_map):%0A        worker = object()%0A        config = %7B'outbound_map': outbound_map%7D%0A        mw = AddressTranslationMiddleware(%22test_addr_trans%22, config, worker)%0A        mw.setup_middleware()%0A        return mw%0A%0A    def mk_msg(self, to_addr='unknown', from_addr='unknown'):%0A        return %7B%0A            'to_addr': to_addr,%0A            'from_addr': from_addr,%0A            %7D%0A%0A    def test_handle_outbound(self):%0A        mw = self.mk_addr_trans(%7B'555OUT': '555IN'%7D)%0A%0A        msg = mw.handle_outbound(self.mk_msg(to_addr=%22555OUT%22), %22outbound%22)%0A        self.assertEqual(msg%5B'to_addr'%5D, %22555IN%22)%0A        msg = mw.handle_outbound(self.mk_msg(to_addr=%22555UNK%22), %22outbound%22)%0A        self.assertEqual(msg%5B'to_addr'%5D, %22555UNK%22)%0A%0A    def test_handle_inbound(self):%0A        mw = self.mk_addr_trans(%7B'555OUT': '555IN'%7D)%0A%0A        msg = mw.handle_inbound(self.mk_msg(from_addr=%22555OUT%22), %22inbound%22)%0A        self.assertEqual(msg%5B'from_addr'%5D, %22555OUT%22)%0A        msg = mw.handle_inbound(self.mk_msg(from_addr=%22555UNK%22), %22inbound%22)%0A        self.assertEqual(msg%5B'from_addr'%5D, %22555UNK%22)%0A

Add test for address translation middleware.