mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-28 09:31:38 +00:00
Merge pull request #111 from ceph/wip-ifmodified
s3tests: modify test_get_object_ifmodifiedsince_failed Reviewed-by: Andrew Gaul <andrew@gaul.org>
This commit is contained in:
commit
66f320a8d5
1 changed files with 8 additions and 5 deletions
|
@ -2357,11 +2357,14 @@ def test_get_object_ifmodifiedsince_failed():
|
||||||
key = bucket.new_key('foo')
|
key = bucket.new_key('foo')
|
||||||
key.set_contents_from_string('bar')
|
key.set_contents_from_string('bar')
|
||||||
|
|
||||||
# Sleep since Amazon returns 200 if the date is in the future:
|
for k in bucket.get_all_keys():
|
||||||
# https://forums.aws.amazon.com/message.jspa?messageID=325930
|
key = k
|
||||||
now = time.time()
|
|
||||||
time.sleep(20)
|
mtime = time.strptime(key.last_modified, '%Y-%m-%dT%H:%M:%S.%fZ')
|
||||||
after = formatdate(now + 10)
|
|
||||||
|
after = time.ctime(time.mktime(mtime) + 1)
|
||||||
|
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
e = assert_raises(boto.exception.S3ResponseError, bucket.get_key, 'foo', headers={'If-Modified-Since': after})
|
e = assert_raises(boto.exception.S3ResponseError, bucket.get_key, 'foo', headers={'If-Modified-Since': after})
|
||||||
eq(e.status, 304)
|
eq(e.status, 304)
|
||||||
|
|
Loading…
Reference in a new issue