def test_load_count(): stream = io.StringIO() a = TextStream(stream) a.write_count(3) stream.seek(0) assert a.load_count() == 3