class TestDispatcherRandom(TestCase): def setUp(self): self.workers = ["w1", "w2"] self.dispatcher = RandomDispatcher(self.workers) def test_return_a_worker(self): self.assertIn(self.dispatcher.get_next(), self.workers) self.assertIn(self.dispatcher.get_next(), self.workers)
def setUp(self): self.workers = ["w1", "w2"] self.dispatcher = RandomDispatcher(self.workers)