def test_send(self): from supervisor.childutils import pcomm stdout = StringIO() pcomm.send('hello', stdout) from supervisor.events import ProcessCommunicationEvent begin = ProcessCommunicationEvent.BEGIN_TOKEN end = ProcessCommunicationEvent.END_TOKEN self.assertEqual(stdout.getvalue(), '%s%s%s' % (begin, 'hello', end))
def test_send(self): from supervisor.childutils import pcomm stdout = BytesIO() pcomm.send(b'hello', stdout) from supervisor.events import ProcessCommunicationEvent begin = ProcessCommunicationEvent.BEGIN_TOKEN end = ProcessCommunicationEvent.END_TOKEN self.assertEqual(stdout.getvalue(), begin + b'hello' + end)