예제 #1
0
def test_response_file_body_tell_text():
    from webob.response import ResponseBodyFile

    rbo = ResponseBodyFile(Response())
    assert rbo.tell() == 0
    rbo.write("123456789")
    assert rbo.tell() == 9
예제 #2
0
def test_response_file_body_tell_text():
    from webob.response import ResponseBodyFile

    rbo = ResponseBodyFile(Response())
    assert rbo.tell() == 0
    rbo.write("123456789")
    assert rbo.tell() == 9
예제 #3
0
def test_response_file_body_tell():
    import zipfile
    from webob.response import ResponseBodyFile
    rbo = ResponseBodyFile(Response())
    assert rbo.tell() == 0
    writer = zipfile.ZipFile(rbo, 'w')
    writer.writestr('zinfo_or_arcname', b'foo')
    writer.close()
    assert rbo.tell() == 133
예제 #4
0
def test_response_file_body_tell():
    import zipfile
    from webob.response import ResponseBodyFile
    rbo = ResponseBodyFile(Response())
    eq_(rbo.tell(), 0)
    writer = zipfile.ZipFile(rbo, 'w')
    writer.writestr('zinfo_or_arcname', b'foo')
    writer.close()
    eq_(rbo.tell(), 133)
예제 #5
0
def test_response_file_body_tell():
    import zipfile
    from webob.response import ResponseBodyFile

    rbo = ResponseBodyFile(Response())
    assert rbo.tell() == 0
    writer = zipfile.ZipFile(rbo, "w")
    writer.writestr("zinfo_or_arcname", b"foo")
    writer.close()
    assert rbo.tell() == 133