(self)
| 1622 | self.assertEqual(len(stdout), len("herpderp") * 5 + 5) |
| 1623 | |
| 1624 | def test_stdout_callback_buffered(self): |
| 1625 | py = create_tmp_test( |
| 1626 | """ |
| 1627 | import sys |
| 1628 | import os |
| 1629 | |
| 1630 | for i in range(5): sys.stdout.write("herpderp") |
| 1631 | """ |
| 1632 | ) |
| 1633 | |
| 1634 | stdout = [] |
| 1635 | |
| 1636 | def agg(chunk): |
| 1637 | stdout.append(chunk) |
| 1638 | |
| 1639 | p = python("-u", py.name, _out=agg, _out_bufsize=4) |
| 1640 | p.wait() |
| 1641 | |
| 1642 | self.assertEqual(len(stdout), len("herp") / 2 * 5) |
| 1643 | |
| 1644 | def test_stdout_callback_with_input(self): |
| 1645 | py = create_tmp_test( |
nothing calls this directly
no test coverage detected