Skip to content

Instantly share code, notes, and snippets.

@chmouel
Created February 20, 2013 15:54
Show Gist options
  • Save chmouel/4996564 to your computer and use it in GitHub Desktop.
Save chmouel/4996564 to your computer and use it in GitHub Desktop.
diff --git a/test/functionalnosetests/test_object.py b/test/functionalnosetests/test_object.py
index a0981d2..f86ab65 100755
--- a/test/functionalnosetests/test_object.py
+++ b/test/functionalnosetests/test_object.py
@@ -22,7 +22,8 @@ from uuid import uuid4
from swift.common.constraints import MAX_META_COUNT, MAX_META_NAME_LENGTH, \
MAX_META_OVERALL_SIZE, MAX_META_VALUE_LENGTH
-from swift_testing import check_response, retry, skip, skip3, swift_test_user
+from swift_testing import check_response, retry, skip, skip3, \
+ swift_test_user, swift_test_tenant
class TestObject(unittest.TestCase):
@@ -414,16 +415,17 @@ class TestObject(unittest.TestCase):
resp.read()
self.assertEquals(resp.status, 403)
+ tenant_user = "%s:%s" % (swift_test_tenant[2],
+ swift_test_user[2])
# Grant access to the third account
def post(url, token, parsed, conn):
conn.request('POST', '%s/%s' % (parsed.path, self.container),
- '', {'X-Auth-Token': token, 'X-Container-Read':
- swift_test_user[2]})
+ '', {'X-Auth-Token': token,
+ 'X-Container-Read': tenant_user})
return check_response(conn)
resp = retry(post)
resp.read()
self.assertEquals(resp.status, 204)
-
# The third account should be able to get the manifest now
def get(url, token, parsed, conn):
conn.request('GET', '%s/%s/manifest' % (parsed.path,
@@ -493,7 +495,7 @@ class TestObject(unittest.TestCase):
def post(url, token, parsed, conn):
conn.request('POST', '%s/%s' % (parsed.path, acontainer),
'', {'X-Auth-Token': token, 'X-Container-Read':
- swift_test_user[2]})
+ tenant_user})
return check_response(conn)
resp = retry(post)
resp.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment