Rev3225, Handle correctly and test out of range bigfile requests

This commit is contained in:
shortcutme 2018-01-21 18:56:30 +01:00
parent 9c4093dc7c
commit 3fb9f900f6
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
3 changed files with 12 additions and 2 deletions

View file

@ -209,6 +209,16 @@ class TestBigfile:
assert len(requests) == 2 # Two block download
# Test out of range request
f.seek(5 * 1024 * 1024)
data = f.read(1024 * 1024 * 30)
assert len(data) == 10 * 1000 * 1000 - (5 * 1024 * 1024)
f.seek(30 * 1024 * 1024)
data = f.read(1024 * 1024 * 30)
assert len(data) == 0
@pytest.mark.parametrize("piecefield_obj", [BigfilePiecefield, BigfilePiecefieldPacked])
def testPiecefield(self, piecefield_obj, site):