コード例 #1
0
ファイル: test_childutils.py プロジェクト: Davidwang79/minos
 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))
コード例 #2
0
 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))
コード例 #3
0
 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)
コード例 #4
0
 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)