Simulates the pipeline sink consuming and running the tests. Test execution is simulated for each test by calling run().
| 21 | |
| 22 | |
| 23 | class FakeExecutionProc(base.TestProc): |
| 24 | """Simulates the pipeline sink consuming and running the tests. |
| 25 | |
| 26 | Test execution is simulated for each test by calling run(). |
| 27 | """ |
| 28 | |
| 29 | def __init__(self): |
| 30 | super(FakeExecutionProc, self).__init__() |
| 31 | self.tests = [] |
| 32 | |
| 33 | def next_test(self, test): |
| 34 | self.tests.append(test) |
| 35 | return True |
| 36 | |
| 37 | def run(self): |
| 38 | test = self.tests.pop() |
| 39 | self._send_result(test, test.n) |
| 40 | |
| 41 | |
| 42 | class FakeResultObserver(base.TestProcObserver): |