Report correct location when reading using explicit size and EOF reached

This commit is contained in:
Erik Johnson 2018-06-17 22:16:22 -05:00
parent 5ec95ba5ca
commit 2be19cfa89
No known key found for this signature in database
GPG Key ID: 5E5583C437808F3F

View File

@ -163,8 +163,9 @@ class MockFH(object):
# requested size, but before doing so, reset read_data to reflect
# what we read.
self.read_data = self._iterate_read_data(joined[size:])
self._loc += size
return joined[:size]
ret = joined[:size]
self._loc += len(ret)
return ret
def _readlines(self, size=None): # pylint: disable=unused-argument
# TODO: Implement "size" argument