示例#1
0
 def setUp(self):
     super(TestWorker, self).setUp()
     self.client_factory = mock.Mock()
     self.client = mock.Mock()
     self.client_factory.return_value = self.client
     self.processor = mock.Mock()
     self.worker = worker.Worker(self.client_factory, self.processor)
示例#2
0
    def setUp(self):
        super(TestWorkerWithMox, self).setUp()
        self.mox = mox.Mox()
        self.client = self.mox.CreateMockAnything()

        def client_factory(*args, **kwargs):
            return self.client

        self.processor = FakeProcessor()
        self.worker = worker.Worker(client_factory, processor=self.processor)