Esempio n. 1
0
    def test_stdout_err(self):
        """
        You can get stdout and stderr.
        """
        p = SimpleProtocol('foo')
        
        p.childDataReceived(1, 'foo')
        p.childDataReceived(2, 'bar')
        self.assertEqual(p.stdout, 'foo')
        self.assertEqual(p.stderr, 'bar')

        p.childDataReceived(1, 'another foo')
        p.childDataReceived(2, 'another bar')        
        self.assertEqual(p.stdout, 'fooanother foo')
        self.assertEqual(p.stderr, 'baranother bar')