@@ -0,0 +1,1416 @@
+from AlphaTwirl.EventReader import MPEventLoopRunner%0Aimport unittest%0A%0A##____________________________________________________________________________%7C%7C%0Aclass MockReader(object):%0A    def __init__(self):%0A        self._results = None%0A%0A    def setResults(self, results):%0A        self._results = results%0A%0A    def results(self):%0A        return self._results%0A%0A##____________________________________________________________________________%7C%7C%0Aclass MockEventLoop(object):%0A    def __init__(self, readers):%0A        self.readers = readers%0A%0A    def __call__(self):%0A        for reader in self.readers:%0A            reader._results = 3456%0A        return self.readers%0A%0A##____________________________________________________________________________%7C%7C%0Aclass TestMPEventLoopRunner(unittest.TestCase):%0A%0A    def test_begin_end(self):%0A        runner = MPEventLoopRunner()%0A        runner.begin()%0A        runner.end()%0A%0A    def test_run(self):%0A        runner = MPEventLoopRunner()%0A        runner.begin()%0A%0A        reader1 = MockReader()%0A        reader2 = MockReader()%0A        eventLoop = MockEventLoop(%5Breader1, reader2%5D)%0A        runner.run(eventLoop)%0A%0A        self.assertIsNone(reader1._results)%0A        self.assertIsNone(reader2._results)%0A%0A        runner.end()%0A%0A        self.assertEqual(3456, reader1._results)%0A        self.assertEqual(3456, reader2._results)%0A%0A##____________________________________________________________________________%7C%7C%0A

add TestMPEventLoopRunner