def test_stdout(self): from supervisor.childutils import pcomm old = sys.stdout try: io = sys.stdout = StringIO() pcomm.stdout('hello') from supervisor.events import ProcessCommunicationEvent begin = ProcessCommunicationEvent.BEGIN_TOKEN end = ProcessCommunicationEvent.END_TOKEN self.assertEqual(io.getvalue(), '%s%s%s' % (begin, 'hello', end)) finally: sys.stdout = old
def test_stdout(self): from supervisor.childutils import pcomm old = sys.stdout try: io = sys.stdout = StringIO() pcomm.stdout('hello') from supervisor.events import ProcessCommunicationEvent begin = ProcessCommunicationEvent.BEGIN_TOKEN end = ProcessCommunicationEvent.END_TOKEN self.assertEqual(io.getvalue(), '%s%s%s' % (begin, 'hello', end)) finally: sys.stdout = old