Пример #1
0
 def test_run(self):
     r = Router()
     r.logger = MockLogger()
     app = r.build_component("rapidsms.tests.%s.MockApp", {"type": "harness", "title": "test app"})
     r.apps.append(app)
     r.add_backend({"type": "backend", "title": "test_backend"})
     backend = r.get_backend("test-backend")  # NOTE the dash; FIXME
     msg = backend.message("test user", "test message")
     r.send(msg)
     r.run()
     received = app.calls[-1][1]
     self.assertEquals(msg, received, "message is identical")
     self.assertEquals(msg.connection, received.connection, "same connection")
     self.assertEquals(msg.text, received.text, "same text")
Пример #2
0
 def test_run(self):
     r = Router()
     r.logger = MockLogger()
     app = r.build_component("rapidsms.tests.%s.MockApp", {
         "type": "harness",
         "title": "test app"
     })
     r.apps.append(app)
     r.add_backend({"type": "backend", "title": "test_backend"})
     backend = r.get_backend("test-backend")  # NOTE the dash; FIXME
     msg = backend.message("test user", "test message")
     r.send(msg)
     r.run()
     received = app.calls[-1][1]
     self.assertEquals(msg, received, "message is identical")
     self.assertEquals(msg.connection, received.connection,
                       "same connection")
     self.assertEquals(msg.text, received.text, "same text")