Example #1
0
def test_load_count():
    stream = io.StringIO()
    a = TextStream(stream)
    a.write_body(3)
    stream.seek(0)
    assert a.load_body() == 3
Example #2
0
def test_write_body():
    stream = io.StringIO()
    a = TextStream(stream)
    a.write_body(3)
    stream.seek(0)
    assert stream.readline() == "3\n"
Example #3
0
def test_load_footer():
    stream = io.StringIO()
    a = TextStream(stream)
    a.write_footer("hoge")
    stream.seek(0)
    assert a.load_footer() == "hoge"
Example #4
0
def test_write_footer():
    stream = io.StringIO()
    a = TextStream(stream)
    a.write_footer("hoge")
    stream.seek(0)
    assert stream.readline() == "/hoge\n"