mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-25 03:47:22 +00:00
Add assert to RandomContentFile, ensure size >= digest_size
It clearly will not work to have the size smaller than the digest size, so we shouldn't allow it.
This commit is contained in:
parent
d0bb148dea
commit
fb8f110e69
1 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,11 @@ class RandomContentFile(object):
|
||||||
self.digest = None
|
self.digest = None
|
||||||
self.last_read = 0
|
self.last_read = 0
|
||||||
|
|
||||||
|
assert self.size >= self.digest_size, "Can not create RandomContentFile: size ({size}) must be >= digest_size ({digest_size})".format(
|
||||||
|
size=self.size,
|
||||||
|
digest_size=self.digest_size
|
||||||
|
)
|
||||||
|
|
||||||
def seek(self, offset):
|
def seek(self, offset):
|
||||||
assert offset == 0
|
assert offset == 0
|
||||||
self.random.seed(self.seed)
|
self.random.seed(self.seed)
|
||||||
|
|
Loading…
Reference in a new issue