(self)
| 51 | |
| 52 | class ThreadedTempFileTest(unittest.TestCase): |
| 53 | def test_main(self): |
| 54 | threads = [TempFileGreedy() for i in range(NUM_THREADS)] |
| 55 | with threading_helper.start_threads(threads, startEvent.set): |
| 56 | pass |
| 57 | ok = sum(t.ok_count for t in threads) |
| 58 | errors = [str(t.name) + str(t.errors.getvalue()) |
| 59 | for t in threads if t.error_count] |
| 60 | |
| 61 | msg = "Errors: errors %d ok %d\n%s" % (len(errors), ok, |
| 62 | '\n'.join(errors)) |
| 63 | self.assertEqual(errors, [], msg) |
| 64 | self.assertEqual(ok, NUM_THREADS * FILES_PER_THREAD) |
| 65 | |
| 66 | if __name__ == "__main__": |
| 67 | unittest.main() |
nothing calls this directly
no test coverage detected