def testInsertMessage(self): t = FakeStub() s = connector.OutgoingConnection(None, 'test', t) s.InsertMessage(common_pb2.Message()) self.assertTrue(t.insert_done) self.assertFalse(t.insert_errors) self.assertEqual(t.message.source.service_name, 'test')
def testDeletePendingMessages(self): t = FakeStub() s = connector.OutgoingConnection(None, 'test', t) s.DeletePendingMessages(admin_pb2.DeletePendingMessagesRequest()) self.assertTrue(t.delete_done) self.assertFalse(t.delete_errors)
def testKeepAlive(self): t = FakeStub() s = connector.OutgoingConnection(None, 'test', t) self.assertTrue(t.event.wait(10)) s.Shutdown()
def testGetPendingMessageCount(self): t = FakeStub() s = connector.OutgoingConnection(None, 'test', t) s.GetPendingMessageCount(admin_pb2.GetPendingMessageCountRequest()) self.assertTrue(t.get_count_done) self.assertFalse(t.get_count_errors)