diff --git a/docs/changes.rst b/docs/changes.rst index c67e14c8..30e22cef 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -1,6 +1,11 @@ Changelog ********* +0.11.10 +======= + +* Azure files handles now correctly implement seek and return the new position. + 0.11.9 ====== * Add option to set the checksum for Azure blobs. diff --git a/simplekv/net/azurestore.py b/simplekv/net/azurestore.py index 9490f466..242037fc 100644 --- a/simplekv/net/azurestore.py +++ b/simplekv/net/azurestore.py @@ -275,6 +275,7 @@ def seek(self, offset, whence=0): if self.size + offset < 0: raise IOError('seek would move position outside the file') self.pos = self.size + offset + return self.pos def seekable(self): return True diff --git a/tests/basic_store.py b/tests/basic_store.py index 43d4c5e5..88b624c7 100644 --- a/tests/basic_store.py +++ b/tests/basic_store.py @@ -382,9 +382,9 @@ def test_open_seek_and_tell_empty_value(self, store, key): store.put(key, value) ok = store.open(key) assert ok.seekable() - ok.seek(10) + assert ok.seek(10) == 10 assert ok.tell() == 10 - ok.seek(-6, 1) + assert ok.seek(-6, 1) == 4 assert ok.tell() == 4 with pytest.raises(IOError): ok.seek(-1, 0)