Ejemplo n.º 1
0
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']
Ejemplo n.º 2
0
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"]
Ejemplo n.º 3
0
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"]
Ejemplo n.º 4
0
def test_response_file_body_flush_is_no_op():
    from webob.response import ResponseBodyFile
    rbo = ResponseBodyFile(None)
    rbo.flush()
Ejemplo n.º 5
0
def test_response_file_body_flush_is_no_op():
    from webob.response import ResponseBodyFile
    rbo = ResponseBodyFile(None)
    rbo.flush()