예제 #1
0
def test_tee_class():
    fileout = StringIO.StringIO()
    stdout = StringIO.StringIO()
    tee = TeeHandler(fileout, stdout)

    tee.write("TEST")
    assert fileout.getvalue() == "TEST"
    assert stdout.getvalue() == "TEST"

    tee.write("SECOND")
    assert fileout.getvalue() == "TESTSECOND"
    assert stdout.getvalue() == "TESTSECOND"
예제 #2
0
def test_tee_class():
    fileout = StringIO.StringIO()
    stdout = StringIO.StringIO()
    tee = TeeHandler(fileout, stdout)

    tee.write("TEST")
    assert fileout.getvalue() == "TEST"
    assert stdout.getvalue() == "TEST"

    tee.write("SECOND")
    assert fileout.getvalue() == "TESTSECOND"
    assert stdout.getvalue() == "TESTSECOND"