コード例 #1
0
ファイル: test_childutils.py プロジェクト: Davidwang79/minos
 def test_stderr(self):
     from supervisor.childutils import pcomm
     old = sys.stderr
     try:
         io = sys.stderr = StringIO()
         pcomm.stderr('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.stderr = old
コード例 #2
0
 def test_stderr(self):
     from supervisor.childutils import pcomm
     old = sys.stderr
     try:
         io = sys.stderr = StringIO()
         pcomm.stderr('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.stderr = old