Commit 40378c77 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

pithos: Fix tests

parent 443234da
......@@ -711,7 +711,7 @@ class ContainerPut(PithosAPITest):
def test_create_twice(self):
self.create_container('c1')
self.assertTrue('c1' in self.list_containers(format=None))
r = self.create_container('c1')
r = self.create_container('c1')[-1]
self.assertEqual(r.status_code, 202)
self.assertTrue('c1' in self.list_containers(format=None))
......
......@@ -59,6 +59,28 @@ merkle = partial(merkle,
blockhash=TEST_HASH_ALGORITHM)
class ObjectHead(PithosAPITest):
def setUp(self):
cname = self.create_container()[0]
oname, odata = self.upload_object(cname)[:-1]
url = join_urls(self.pithos_path, cname, oname)
r = self.head(url)
map(lambda i: self.assertTrue(i in r),
['Etag',
'Content-Length',
'Content-Type',
'Last-Modified',
'Content-Encoding',
'Content-Disposition',
'X-Object-Hash',
'X-Object-UUID',
'X-Object-Version',
'X-Object-Version-Timestamp',
'X-Object-Modified-By',
'X-Object-Manifest'])
class ObjectGet(PithosAPITest):
def setUp(self):
PithosAPITest.setUp(self)
......@@ -406,7 +428,7 @@ class ObjectGet(PithosAPITest):
for t in t1_formats:
r = self.get(url, HTTP_IF_UNMODIFIED_SINCE=t)
self.assertEqual(r.status_code, 200)
self.assertEqual(odata, odata)
self.assertEqual(r.content, odata)
# modify object
_time.sleep(2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment