Fix usage of multiple accounts in functional tests
Some tests make use of multiple accounts without checking of they have been set up. This commit tries to fix some of these situations. Change-Id: I461679e78e19ce0866c7618c581a8cb573cca7f5
This commit is contained in:
@@ -64,19 +64,21 @@ class TestSloEnv(BaseEnv):
|
|||||||
|
|
||||||
super(TestSloEnv, cls).setUp()
|
super(TestSloEnv, cls).setUp()
|
||||||
|
|
||||||
config2 = deepcopy(tf.config)
|
if not tf.skip2:
|
||||||
config2['account'] = tf.config['account2']
|
config2 = deepcopy(tf.config)
|
||||||
config2['username'] = tf.config['username2']
|
config2['account'] = tf.config['account2']
|
||||||
config2['password'] = tf.config['password2']
|
config2['username'] = tf.config['username2']
|
||||||
cls.conn2 = Connection(config2)
|
config2['password'] = tf.config['password2']
|
||||||
cls.conn2.authenticate()
|
cls.conn2 = Connection(config2)
|
||||||
cls.account2 = cls.conn2.get_account()
|
cls.conn2.authenticate()
|
||||||
cls.account2.delete_containers()
|
cls.account2 = cls.conn2.get_account()
|
||||||
config3 = tf.config.copy()
|
cls.account2.delete_containers()
|
||||||
config3['username'] = tf.config['username3']
|
if not tf.skip3:
|
||||||
config3['password'] = tf.config['password3']
|
config3 = tf.config.copy()
|
||||||
cls.conn3 = Connection(config3)
|
config3['username'] = tf.config['username3']
|
||||||
cls.conn3.authenticate()
|
config3['password'] = tf.config['password3']
|
||||||
|
cls.conn3 = Connection(config3)
|
||||||
|
cls.conn3.authenticate()
|
||||||
|
|
||||||
cls.container = cls.account.container(Utils.create_name())
|
cls.container = cls.account.container(Utils.create_name())
|
||||||
cls.container2 = cls.account.container(Utils.create_name())
|
cls.container2 = cls.account.container(Utils.create_name())
|
||||||
@@ -651,18 +653,19 @@ class TestSlo(Base):
|
|||||||
copied_contents = copied.read(parms={'multipart-manifest': 'get'})
|
copied_contents = copied.read(parms={'multipart-manifest': 'get'})
|
||||||
self.assertEqual(4 * 1024 * 1024 + 1, len(copied_contents))
|
self.assertEqual(4 * 1024 * 1024 + 1, len(copied_contents))
|
||||||
|
|
||||||
# copy to different account
|
if not tf.skip2:
|
||||||
acct = self.env.conn2.account_name
|
# copy to different account
|
||||||
dest_cont = self.env.account2.container(Utils.create_name())
|
acct = self.env.conn2.account_name
|
||||||
self.assertTrue(dest_cont.create(hdrs={
|
dest_cont = self.env.account2.container(Utils.create_name())
|
||||||
'X-Container-Write': self.env.conn.user_acl
|
self.assertTrue(dest_cont.create(hdrs={
|
||||||
}))
|
'X-Container-Write': self.env.conn.user_acl
|
||||||
file_item = self.env.container.file("manifest-abcde")
|
}))
|
||||||
file_item.copy_account(acct, dest_cont, "copied-abcde")
|
file_item = self.env.container.file("manifest-abcde")
|
||||||
|
file_item.copy_account(acct, dest_cont, "copied-abcde")
|
||||||
|
|
||||||
copied = dest_cont.file("copied-abcde")
|
copied = dest_cont.file("copied-abcde")
|
||||||
copied_contents = copied.read(parms={'multipart-manifest': 'get'})
|
copied_contents = copied.read(parms={'multipart-manifest': 'get'})
|
||||||
self.assertEqual(4 * 1024 * 1024 + 1, len(copied_contents))
|
self.assertEqual(4 * 1024 * 1024 + 1, len(copied_contents))
|
||||||
|
|
||||||
def test_slo_copy_the_manifest(self):
|
def test_slo_copy_the_manifest(self):
|
||||||
source = self.env.container.file("manifest-abcde")
|
source = self.env.container.file("manifest-abcde")
|
||||||
@@ -797,6 +800,8 @@ class TestSlo(Base):
|
|||||||
self.assertEqual(slo_etag, actual['slo_etag'])
|
self.assertEqual(slo_etag, actual['slo_etag'])
|
||||||
|
|
||||||
def test_slo_copy_the_manifest_account(self):
|
def test_slo_copy_the_manifest_account(self):
|
||||||
|
if tf.skip2:
|
||||||
|
raise SkipTest('Account2 not set')
|
||||||
acct = self.env.conn.account_name
|
acct = self.env.conn.account_name
|
||||||
# same account
|
# same account
|
||||||
file_item = self.env.container.file("manifest-abcde")
|
file_item = self.env.container.file("manifest-abcde")
|
||||||
@@ -1148,6 +1153,8 @@ class TestSlo(Base):
|
|||||||
self.assert_status(200)
|
self.assert_status(200)
|
||||||
|
|
||||||
def test_slo_referer_on_segment_container(self):
|
def test_slo_referer_on_segment_container(self):
|
||||||
|
if tf.skip3:
|
||||||
|
raise SkipTest('Username3 not set')
|
||||||
# First the account2 (test3) should fail
|
# First the account2 (test3) should fail
|
||||||
headers = {'X-Auth-Token': self.env.conn3.storage_token,
|
headers = {'X-Auth-Token': self.env.conn3.storage_token,
|
||||||
'Referer': 'http://blah.example.com'}
|
'Referer': 'http://blah.example.com'}
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ class TestSymlinkEnv(BaseEnv):
|
|||||||
enumerate([cls.containers(), [cls.link_cont]], 1)]
|
enumerate([cls.containers(), [cls.link_cont]], 1)]
|
||||||
# delete objects inside container
|
# delete objects inside container
|
||||||
for use_account, containers in delete_containers:
|
for use_account, containers in delete_containers:
|
||||||
|
if use_account == 2 and tf.skip2:
|
||||||
|
continue
|
||||||
for container in containers:
|
for container in containers:
|
||||||
while True:
|
while True:
|
||||||
cont = container
|
cont = container
|
||||||
@@ -144,6 +146,8 @@ class TestSymlinkEnv(BaseEnv):
|
|||||||
|
|
||||||
# delete the containers
|
# delete the containers
|
||||||
for use_account, containers in delete_containers:
|
for use_account, containers in delete_containers:
|
||||||
|
if use_account == 2 and tf.skip2:
|
||||||
|
continue
|
||||||
for container in containers:
|
for container in containers:
|
||||||
resp = retry(cls._make_request, method='DELETE',
|
resp = retry(cls._make_request, method='DELETE',
|
||||||
container=container,
|
container=container,
|
||||||
|
|||||||
@@ -410,24 +410,31 @@ class TestContainerTempurlEnv(BaseEnv):
|
|||||||
cls.tempurl_key = Utils.create_name()
|
cls.tempurl_key = Utils.create_name()
|
||||||
cls.tempurl_key2 = Utils.create_name()
|
cls.tempurl_key2 = Utils.create_name()
|
||||||
|
|
||||||
# creating another account and connection
|
if not tf.skip2:
|
||||||
# for ACL tests
|
# creating another account and connection
|
||||||
config2 = deepcopy(tf.config)
|
# for ACL tests
|
||||||
config2['account'] = tf.config['account2']
|
config2 = deepcopy(tf.config)
|
||||||
config2['username'] = tf.config['username2']
|
config2['account'] = tf.config['account2']
|
||||||
config2['password'] = tf.config['password2']
|
config2['username'] = tf.config['username2']
|
||||||
cls.conn2 = Connection(config2)
|
config2['password'] = tf.config['password2']
|
||||||
cls.conn2.authenticate()
|
cls.conn2 = Connection(config2)
|
||||||
cls.account2 = Account(
|
cls.conn2.authenticate()
|
||||||
cls.conn2, config2.get('account', config2['username']))
|
cls.account2 = Account(
|
||||||
cls.account2 = cls.conn2.get_account()
|
cls.conn2, config2.get('account', config2['username']))
|
||||||
|
cls.account2 = cls.conn2.get_account()
|
||||||
|
|
||||||
cls.container = cls.account.container(Utils.create_name())
|
cls.container = cls.account.container(Utils.create_name())
|
||||||
if not cls.container.create({
|
if not tf.skip2:
|
||||||
'x-container-meta-temp-url-key': cls.tempurl_key,
|
if not cls.container.create({
|
||||||
'x-container-meta-temp-url-key-2': cls.tempurl_key2,
|
'x-container-meta-temp-url-key': cls.tempurl_key,
|
||||||
'x-container-read': cls.account2.name}):
|
'x-container-meta-temp-url-key-2': cls.tempurl_key2,
|
||||||
raise ResponseError(cls.conn.response)
|
'x-container-read': cls.account2.name}):
|
||||||
|
raise ResponseError(cls.conn.response)
|
||||||
|
else:
|
||||||
|
if not cls.container.create({
|
||||||
|
'x-container-meta-temp-url-key': cls.tempurl_key,
|
||||||
|
'x-container-meta-temp-url-key-2': cls.tempurl_key2}):
|
||||||
|
raise ResponseError(cls.conn.response)
|
||||||
|
|
||||||
cls.obj = cls.container.file(Utils.create_name())
|
cls.obj = cls.container.file(Utils.create_name())
|
||||||
cls.obj.write("obj contents")
|
cls.obj.write("obj contents")
|
||||||
@@ -583,6 +590,8 @@ class TestContainerTempurl(Base):
|
|||||||
|
|
||||||
@requires_acls
|
@requires_acls
|
||||||
def test_tempurl_keys_hidden_from_acl_readonly(self):
|
def test_tempurl_keys_hidden_from_acl_readonly(self):
|
||||||
|
if tf.skip2:
|
||||||
|
raise SkipTest('Account2 not set')
|
||||||
metadata = self.env.container.info(cfg={
|
metadata = self.env.container.info(cfg={
|
||||||
'use_token': self.env.conn2.storage_token})
|
'use_token': self.env.conn2.storage_token})
|
||||||
|
|
||||||
|
|||||||
@@ -45,13 +45,14 @@ class TestObjectVersioningEnv(BaseEnv):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUp(cls):
|
def setUp(cls):
|
||||||
super(TestObjectVersioningEnv, cls).setUp()
|
super(TestObjectVersioningEnv, cls).setUp()
|
||||||
# Second connection for ACL tests
|
if not tf.skip2:
|
||||||
config2 = deepcopy(tf.config)
|
# Second connection for ACL tests
|
||||||
config2['account'] = tf.config['account2']
|
config2 = deepcopy(tf.config)
|
||||||
config2['username'] = tf.config['username2']
|
config2['account'] = tf.config['account2']
|
||||||
config2['password'] = tf.config['password2']
|
config2['username'] = tf.config['username2']
|
||||||
cls.conn2 = Connection(config2)
|
config2['password'] = tf.config['password2']
|
||||||
cls.conn2.authenticate()
|
cls.conn2 = Connection(config2)
|
||||||
|
cls.conn2.authenticate()
|
||||||
|
|
||||||
# avoid getting a prefix that stops halfway through an encoded
|
# avoid getting a prefix that stops halfway through an encoded
|
||||||
# character
|
# character
|
||||||
@@ -74,24 +75,26 @@ class TestObjectVersioningEnv(BaseEnv):
|
|||||||
# if versioning is off, then cls.location_header_key won't persist
|
# if versioning is off, then cls.location_header_key won't persist
|
||||||
cls.versioning_enabled = 'versions' in container_info
|
cls.versioning_enabled = 'versions' in container_info
|
||||||
|
|
||||||
# setup another account to test ACLs
|
if not tf.skip2:
|
||||||
config2 = deepcopy(tf.config)
|
# setup another account to test ACLs
|
||||||
config2['account'] = tf.config['account2']
|
config2 = deepcopy(tf.config)
|
||||||
config2['username'] = tf.config['username2']
|
config2['account'] = tf.config['account2']
|
||||||
config2['password'] = tf.config['password2']
|
config2['username'] = tf.config['username2']
|
||||||
cls.conn2 = Connection(config2)
|
config2['password'] = tf.config['password2']
|
||||||
cls.storage_url2, cls.storage_token2 = cls.conn2.authenticate()
|
cls.conn2 = Connection(config2)
|
||||||
cls.account2 = cls.conn2.get_account()
|
cls.storage_url2, cls.storage_token2 = cls.conn2.authenticate()
|
||||||
cls.account2.delete_containers()
|
cls.account2 = cls.conn2.get_account()
|
||||||
|
cls.account2.delete_containers()
|
||||||
|
|
||||||
# setup another account with no access to anything to test ACLs
|
if not tf.skip3:
|
||||||
config3 = deepcopy(tf.config)
|
# setup another account with no access to anything to test ACLs
|
||||||
config3['account'] = tf.config['account']
|
config3 = deepcopy(tf.config)
|
||||||
config3['username'] = tf.config['username3']
|
config3['account'] = tf.config['account']
|
||||||
config3['password'] = tf.config['password3']
|
config3['username'] = tf.config['username3']
|
||||||
cls.conn3 = Connection(config3)
|
config3['password'] = tf.config['password3']
|
||||||
cls.storage_url3, cls.storage_token3 = cls.conn3.authenticate()
|
cls.conn3 = Connection(config3)
|
||||||
cls.account3 = cls.conn3.get_account()
|
cls.storage_url3, cls.storage_token3 = cls.conn3.authenticate()
|
||||||
|
cls.account3 = cls.conn3.get_account()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDown(cls):
|
def tearDown(cls):
|
||||||
@@ -131,13 +134,14 @@ class TestCrossPolicyObjectVersioningEnv(BaseEnv):
|
|||||||
policy = cls.policies.select()
|
policy = cls.policies.select()
|
||||||
version_policy = cls.policies.exclude(name=policy['name']).select()
|
version_policy = cls.policies.exclude(name=policy['name']).select()
|
||||||
|
|
||||||
# Second connection for ACL tests
|
if not tf.skip2:
|
||||||
config2 = deepcopy(tf.config)
|
# Second connection for ACL tests
|
||||||
config2['account'] = tf.config['account2']
|
config2 = deepcopy(tf.config)
|
||||||
config2['username'] = tf.config['username2']
|
config2['account'] = tf.config['account2']
|
||||||
config2['password'] = tf.config['password2']
|
config2['username'] = tf.config['username2']
|
||||||
cls.conn2 = Connection(config2)
|
config2['password'] = tf.config['password2']
|
||||||
cls.conn2.authenticate()
|
cls.conn2 = Connection(config2)
|
||||||
|
cls.conn2.authenticate()
|
||||||
|
|
||||||
# avoid getting a prefix that stops halfway through an encoded
|
# avoid getting a prefix that stops halfway through an encoded
|
||||||
# character
|
# character
|
||||||
@@ -161,24 +165,26 @@ class TestCrossPolicyObjectVersioningEnv(BaseEnv):
|
|||||||
# if versioning is off, then X-Versions-Location won't persist
|
# if versioning is off, then X-Versions-Location won't persist
|
||||||
cls.versioning_enabled = 'versions' in container_info
|
cls.versioning_enabled = 'versions' in container_info
|
||||||
|
|
||||||
# setup another account to test ACLs
|
if not tf.skip2:
|
||||||
config2 = deepcopy(tf.config)
|
# setup another account to test ACLs
|
||||||
config2['account'] = tf.config['account2']
|
config2 = deepcopy(tf.config)
|
||||||
config2['username'] = tf.config['username2']
|
config2['account'] = tf.config['account2']
|
||||||
config2['password'] = tf.config['password2']
|
config2['username'] = tf.config['username2']
|
||||||
cls.conn2 = Connection(config2)
|
config2['password'] = tf.config['password2']
|
||||||
cls.storage_url2, cls.storage_token2 = cls.conn2.authenticate()
|
cls.conn2 = Connection(config2)
|
||||||
cls.account2 = cls.conn2.get_account()
|
cls.storage_url2, cls.storage_token2 = cls.conn2.authenticate()
|
||||||
cls.account2.delete_containers()
|
cls.account2 = cls.conn2.get_account()
|
||||||
|
cls.account2.delete_containers()
|
||||||
|
|
||||||
# setup another account with no access to anything to test ACLs
|
if not tf.skip3:
|
||||||
config3 = deepcopy(tf.config)
|
# setup another account with no access to anything to test ACLs
|
||||||
config3['account'] = tf.config['account']
|
config3 = deepcopy(tf.config)
|
||||||
config3['username'] = tf.config['username3']
|
config3['account'] = tf.config['account']
|
||||||
config3['password'] = tf.config['password3']
|
config3['username'] = tf.config['username3']
|
||||||
cls.conn3 = Connection(config3)
|
config3['password'] = tf.config['password3']
|
||||||
cls.storage_url3, cls.storage_token3 = cls.conn3.authenticate()
|
cls.conn3 = Connection(config3)
|
||||||
cls.account3 = cls.conn3.get_account()
|
cls.storage_url3, cls.storage_token3 = cls.conn3.authenticate()
|
||||||
|
cls.account3 = cls.conn3.get_account()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDown(cls):
|
def tearDown(cls):
|
||||||
@@ -485,6 +491,8 @@ class TestObjectVersioning(Base):
|
|||||||
self.assertEqual("old content", man_file.read())
|
self.assertEqual("old content", man_file.read())
|
||||||
|
|
||||||
def test_versioning_container_acl(self):
|
def test_versioning_container_acl(self):
|
||||||
|
if tf.skip2:
|
||||||
|
raise SkipTest('Account2 not set')
|
||||||
# create versions container and DO NOT give write access to account2
|
# create versions container and DO NOT give write access to account2
|
||||||
versions_container = self.env.account.container(Utils.create_name())
|
versions_container = self.env.account.container(Utils.create_name())
|
||||||
location_header_val = quote(str(versions_container))
|
location_header_val = quote(str(versions_container))
|
||||||
@@ -623,6 +631,8 @@ class TestObjectVersioning(Base):
|
|||||||
return versioned_obj
|
return versioned_obj
|
||||||
|
|
||||||
def test_versioning_check_acl(self):
|
def test_versioning_check_acl(self):
|
||||||
|
if tf.skip2:
|
||||||
|
raise SkipTest('Account2 not set')
|
||||||
versioned_obj = self._test_versioning_check_acl_setup()
|
versioned_obj = self._test_versioning_check_acl_setup()
|
||||||
versioned_obj.delete()
|
versioned_obj.delete()
|
||||||
self.assertEqual("aaaaa", versioned_obj.read())
|
self.assertEqual("aaaaa", versioned_obj.read())
|
||||||
@@ -896,6 +906,8 @@ class TestObjectVersioningHistoryMode(TestObjectVersioning):
|
|||||||
self.assertEqual(expected, bodies)
|
self.assertEqual(expected, bodies)
|
||||||
|
|
||||||
def test_versioning_check_acl(self):
|
def test_versioning_check_acl(self):
|
||||||
|
if tf.skip2:
|
||||||
|
raise SkipTest('Account2 not set')
|
||||||
versioned_obj = self._test_versioning_check_acl_setup()
|
versioned_obj = self._test_versioning_check_acl_setup()
|
||||||
versioned_obj.delete()
|
versioned_obj.delete()
|
||||||
with self.assertRaises(ResponseError) as cm:
|
with self.assertRaises(ResponseError) as cm:
|
||||||
|
|||||||
@@ -1189,17 +1189,18 @@ class TestFileEnv(BaseEnv):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUp(cls):
|
def setUp(cls):
|
||||||
super(TestFileEnv, cls).setUp()
|
super(TestFileEnv, cls).setUp()
|
||||||
# creating another account and connection
|
if not tf.skip2:
|
||||||
# for account to account copy tests
|
# creating another account and connection
|
||||||
config2 = deepcopy(tf.config)
|
# for account to account copy tests
|
||||||
config2['account'] = tf.config['account2']
|
config2 = deepcopy(tf.config)
|
||||||
config2['username'] = tf.config['username2']
|
config2['account'] = tf.config['account2']
|
||||||
config2['password'] = tf.config['password2']
|
config2['username'] = tf.config['username2']
|
||||||
cls.conn2 = Connection(config2)
|
config2['password'] = tf.config['password2']
|
||||||
cls.conn2.authenticate()
|
cls.conn2 = Connection(config2)
|
||||||
|
cls.conn2.authenticate()
|
||||||
|
|
||||||
cls.account2 = cls.conn2.get_account()
|
cls.account2 = cls.conn2.get_account()
|
||||||
cls.account2.delete_containers()
|
cls.account2.delete_containers()
|
||||||
|
|
||||||
cls.container = cls.account.container(Utils.create_name())
|
cls.container = cls.account.container(Utils.create_name())
|
||||||
if not cls.container.create():
|
if not cls.container.create():
|
||||||
@@ -1214,7 +1215,8 @@ class TestFileEnv(BaseEnv):
|
|||||||
# not have been known. So we ensure that the project domain id is
|
# not have been known. So we ensure that the project domain id is
|
||||||
# in sysmeta by making a POST to the accounts using an admin role.
|
# in sysmeta by making a POST to the accounts using an admin role.
|
||||||
cls.account.update_metadata()
|
cls.account.update_metadata()
|
||||||
cls.account2.update_metadata()
|
if not tf.skip2:
|
||||||
|
cls.account2.update_metadata()
|
||||||
|
|
||||||
|
|
||||||
class TestFileDev(Base):
|
class TestFileDev(Base):
|
||||||
@@ -1495,28 +1497,29 @@ class TestFile(Base):
|
|||||||
self.assertTrue(file_item.initialize())
|
self.assertTrue(file_item.initialize())
|
||||||
self.assertEqual(metadata, file_item.metadata)
|
self.assertEqual(metadata, file_item.metadata)
|
||||||
|
|
||||||
dest_cont = self.env.account2.container(Utils.create_name())
|
if not tf.skip2:
|
||||||
self.assertTrue(dest_cont.create(hdrs={
|
dest_cont = self.env.account2.container(Utils.create_name())
|
||||||
'X-Container-Write': self.env.conn.user_acl
|
self.assertTrue(dest_cont.create(hdrs={
|
||||||
}))
|
'X-Container-Write': self.env.conn.user_acl
|
||||||
|
}))
|
||||||
|
|
||||||
acct = self.env.conn2.account_name
|
acct = self.env.conn2.account_name
|
||||||
# copy both with and without initial slash
|
# copy both with and without initial slash
|
||||||
for prefix in ('', '/'):
|
for prefix in ('', '/'):
|
||||||
dest_filename = Utils.create_name()
|
dest_filename = Utils.create_name()
|
||||||
|
|
||||||
file_item = self.env.container.file(source_filename)
|
file_item = self.env.container.file(source_filename)
|
||||||
file_item.copy_account(acct,
|
file_item.copy_account(acct,
|
||||||
'%s%s' % (prefix, dest_cont),
|
'%s%s' % (prefix, dest_cont),
|
||||||
dest_filename)
|
dest_filename)
|
||||||
|
|
||||||
self.assertIn(dest_filename, dest_cont.files())
|
self.assertIn(dest_filename, dest_cont.files())
|
||||||
|
|
||||||
file_item = dest_cont.file(dest_filename)
|
file_item = dest_cont.file(dest_filename)
|
||||||
|
|
||||||
self.assertEqual(data, file_item.read())
|
self.assertEqual(data, file_item.read())
|
||||||
self.assertTrue(file_item.initialize())
|
self.assertTrue(file_item.initialize())
|
||||||
self.assertEqual(metadata, file_item.metadata)
|
self.assertEqual(metadata, file_item.metadata)
|
||||||
|
|
||||||
def testCopy404s(self):
|
def testCopy404s(self):
|
||||||
source_filename = Utils.create_name()
|
source_filename = Utils.create_name()
|
||||||
@@ -1559,6 +1562,8 @@ class TestFile(Base):
|
|||||||
Utils.create_name())
|
Utils.create_name())
|
||||||
|
|
||||||
def testCopyAccount404s(self):
|
def testCopyAccount404s(self):
|
||||||
|
if tf.skip2:
|
||||||
|
raise SkipTest('Account2 not set')
|
||||||
acct = self.env.conn.account_name
|
acct = self.env.conn.account_name
|
||||||
acct2 = self.env.conn2.account_name
|
acct2 = self.env.conn2.account_name
|
||||||
source_filename = Utils.create_name()
|
source_filename = Utils.create_name()
|
||||||
@@ -1686,6 +1691,8 @@ class TestFile(Base):
|
|||||||
self.assertEqual(metadata, file_item.metadata)
|
self.assertEqual(metadata, file_item.metadata)
|
||||||
|
|
||||||
def testCopyFromAccountHeader(self):
|
def testCopyFromAccountHeader(self):
|
||||||
|
if tf.skip2:
|
||||||
|
raise SkipTest('Account2 not set')
|
||||||
acct = self.env.conn.account_name
|
acct = self.env.conn.account_name
|
||||||
src_cont = self.env.account.container(Utils.create_name())
|
src_cont = self.env.account.container(Utils.create_name())
|
||||||
self.assertTrue(src_cont.create(hdrs={
|
self.assertTrue(src_cont.create(hdrs={
|
||||||
@@ -1761,6 +1768,8 @@ class TestFile(Base):
|
|||||||
self.assert_status(404)
|
self.assert_status(404)
|
||||||
|
|
||||||
def testCopyFromAccountHeader404s(self):
|
def testCopyFromAccountHeader404s(self):
|
||||||
|
if tf.skip2:
|
||||||
|
raise SkipTest('Account2 not set')
|
||||||
acct = self.env.conn2.account_name
|
acct = self.env.conn2.account_name
|
||||||
src_cont = self.env.account2.container(Utils.create_name())
|
src_cont = self.env.account2.container(Utils.create_name())
|
||||||
self.assertTrue(src_cont.create(hdrs={
|
self.assertTrue(src_cont.create(hdrs={
|
||||||
@@ -1805,6 +1814,8 @@ class TestFile(Base):
|
|||||||
self.assert_status(404)
|
self.assert_status(404)
|
||||||
|
|
||||||
def testCopyFromAccountHeader403s(self):
|
def testCopyFromAccountHeader403s(self):
|
||||||
|
if tf.skip2:
|
||||||
|
raise SkipTest('Account2 not set')
|
||||||
acct = self.env.conn2.account_name
|
acct = self.env.conn2.account_name
|
||||||
src_cont = self.env.account2.container(Utils.create_name())
|
src_cont = self.env.account2.container(Utils.create_name())
|
||||||
self.assertTrue(src_cont.create()) # Primary user has no access
|
self.assertTrue(src_cont.create()) # Primary user has no access
|
||||||
|
|||||||
Reference in New Issue
Block a user