Exemple #1
0
 def test__logs_only_full_lines_from_stderr(self):
     message = factory.make_name("message")
     callback = Mock()
     proto = JSONPerLineProtocol(callback=callback)
     proto.connectionMade()
     with TwistedLoggerFixture() as logger:
         proto.errReceived(message.encode("ascii"))
     self.assertThat(logger.output, Equals(""))
Exemple #2
0
 def test__logs_stderr_at_process_end(self):
     message = factory.make_name("message")
     callback = Mock()
     proto = JSONPerLineProtocol(callback=callback)
     proto.connectionMade()
     with TwistedLoggerFixture() as logger:
         proto.errReceived(message.encode("ascii"))
         self.assertThat(logger.output, Equals(""))
         proto.processEnded(Failure(ProcessDone(0)))
     self.assertThat(logger.output, Equals(message))