def test_response_file_body_writelines(): from webob.response import ResponseBodyFile res = Response(app_iter=[b'foo']) rbo = ResponseBodyFile(res) rbo.writelines(['bar', 'baz']) assert res.app_iter == [b'foo', b'bar', b'baz'] rbo.flush() # noop assert res.app_iter, [b'foo', b'bar', b'baz']
def test_response_file_body_writelines(): from webob.response import ResponseBodyFile res = Response(app_iter=[b"foo"]) rbo = ResponseBodyFile(res) rbo.writelines(["bar", "baz"]) assert res.app_iter == [b"foo", b"bar", b"baz"] rbo.flush() # noop assert res.app_iter, [b"foo", b"bar", b"baz"]
def test_response_file_body_flush_is_no_op(): from webob.response import ResponseBodyFile rbo = ResponseBodyFile(None) rbo.flush()