def test_stderrNoErrput(self): """ recordStderr ignores empty errput sent to it """ btr = BaseTestResult(None, None) pt = ProtoTest() btr.recordStderr(pt, '') self.assertEqual(btr.stderr_errput, {})
def test_stdoutNoOutput(self): """ recordStdout ignores empty output sent to it """ btr = BaseTestResult(None, None) pt = ProtoTest() btr.recordStdout(pt, '') self.assertEqual(btr.stdout_output, {})
def test_stderrErrput(self): """ recordStderr records errput. """ btr = BaseTestResult(None, None) pt = ProtoTest() o = "some errput" btr.recordStderr(pt, o) self.assertEqual(btr.stderr_errput[pt], o)
def test_stdoutOutput(self): """ recordStdout records output. """ btr = BaseTestResult(None, None) pt = ProtoTest() o = "some output" btr.recordStdout(pt, o) self.assertEqual(btr.stdout_output[pt], o)
def test_displayStderr(self): """ displayStderr displays captured stderr """ stream = StringIO() noise = "blah blah blah" btr = BaseTestResult(stream, Colors(False)) pt = ProtoTest() btr.stderr_errput[pt] = noise btr.displayStderr(pt) self.assertIn(noise, stream.getvalue())