Esempio n. 1
0
def test_seek_file_bigger_than_buffer():
    old_max_buf = InputFile.max_buffer_size
    InputFile.max_buffer_size = 10

    try:
        input_file = InputFile(rfile, len(bstr))

        input_file.seek(2)
        test_file.seek(2)
        assert input_file.read(1) == test_file.read(1)

        input_file.seek(4)
        test_file.seek(4)
        assert input_file.read(1) == test_file.read(1)
    finally:
        InputFile.max_buffer_size = old_max_buf
def test_seek_file_bigger_than_buffer():
    old_max_buf = InputFile.max_buffer_size
    InputFile.max_buffer_size = 10

    try:
        input_file = InputFile(rfile, len(bstr))

        input_file.seek(2)
        test_file.seek(2)
        assert input_file.read(1) == test_file.read(1)

        input_file.seek(4)
        test_file.seek(4)
        assert input_file.read(1) == test_file.read(1)
    finally:
        InputFile.max_buffer_size = old_max_buf
Esempio n. 3
0
def test_read_file_bigger_than_buffer():
    old_max_buf = InputFile.max_buffer_size
    InputFile.max_buffer_size = 10

    try:
        input_file = InputFile(rfile, len(bstr))
        assert input_file.read() == test_file.read()
    finally:
        InputFile.max_buffer_size = old_max_buf
def test_read_file_bigger_than_buffer():
    old_max_buf = InputFile.max_buffer_size
    InputFile.max_buffer_size = 10

    try:
        input_file = InputFile(rfile, len(bstr))
        assert input_file.read() == test_file.read()
    finally:
        InputFile.max_buffer_size = old_max_buf