From 0014f2c828dae5f9481a2bac68fe90a7857b2f59 Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Sat, 31 Aug 2013 20:25:25 -0400 Subject: [PATCH] Pep8 the functional tests (2 of 12) Change-Id: Id8a9ae0c82052baccf8bdacd6aaeb76a76ad2ce1 Signed-off-by: Peter Portante --- test/functional/swift_test_client.py | 10 ++++----- test/functional/tests.py | 32 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/test/functional/swift_test_client.py b/test/functional/swift_test_client.py index 456e1393da..6f11762e12 100644 --- a/test/functional/swift_test_client.py +++ b/test/functional/swift_test_client.py @@ -131,12 +131,10 @@ class Connection(object): auth_netloc = "%s:%d" % (self.auth_host, self.auth_port) auth_url = auth_scheme + auth_netloc + auth_path - (storage_url, storage_token) = get_auth(auth_url, - auth_user, self.password, - snet=False, - tenant_name=self.account, - auth_version=self.auth_version, - os_options={}) + (storage_url, storage_token) = get_auth( + auth_url, auth_user, self.password, snet=False, + tenant_name=self.account, auth_version=self.auth_version, + os_options={}) if not (storage_url and storage_token): raise AuthenticationFailed() diff --git a/test/functional/tests.py b/test/functional/tests.py index 8a780af917..9728379e60 100644 --- a/test/functional/tests.py +++ b/test/functional/tests.py @@ -70,6 +70,7 @@ for k in default_constraints: web_front_end = config.get('web_front_end', 'integral') normalized_urls = config.get('normalized_urls', False) + def load_constraint(name): c = config[name] if not isinstance(c, int): @@ -269,7 +270,7 @@ class TestAccount(Base): for format_type in ['json', 'xml']: for a in self.env.account.containers( - parms={'format': format_type}): + parms={'format': format_type}): self.assert_(a['count'] >= 0) self.assert_(a['bytes'] >= 0) @@ -573,7 +574,7 @@ class TestContainer(Base): def testFileCreateInContainerThatDoesNotExist(self): file_item = File(self.env.conn, self.env.account, Utils.create_name(), - Utils.create_name()) + Utils.create_name()) self.assertRaises(ResponseError, file_item.write) self.assert_status(404) @@ -737,8 +738,9 @@ class TestContainerPathsEnv: if f.endswith('/'): file_item.write(hdrs={'Content-Type': 'application/directory'}) else: - file_item.write_random(cls.file_size, hdrs={'Content-Type': - 'application/directory'}) + file_item.write_random(cls.file_size, + hdrs={'Content-Type': + 'application/directory'}) if (normalized_urls): nfile = '/'.join(filter(None, f.split('/'))) if (f[-1] == '/'): @@ -749,8 +751,6 @@ class TestContainerPathsEnv: cls.stored_files = sorted(stored_files) - - class TestContainerPaths(Base): env = TestContainerPathsEnv set_up = False @@ -928,30 +928,30 @@ class TestFile(Base): source_cont = self.env.account.container(Utils.create_name()) file_item = source_cont.file(source_filename) self.assert_(not file_item.copy( - '%s%s' % (prefix, self.env.container), - Utils.create_name())) + '%s%s' % (prefix, self.env.container), + Utils.create_name())) self.assert_status(404) self.assert_(not file_item.copy('%s%s' % (prefix, dest_cont), - Utils.create_name())) + Utils.create_name())) self.assert_status(404) # invalid source object file_item = self.env.container.file(Utils.create_name()) self.assert_(not file_item.copy( - '%s%s' % (prefix, self.env.container), - Utils.create_name())) + '%s%s' % (prefix, self.env.container), + Utils.create_name())) self.assert_status(404) self.assert_(not file_item.copy('%s%s' % (prefix, dest_cont), - Utils.create_name())) + Utils.create_name())) self.assert_status(404) # invalid destination container file_item = self.env.container.file(source_filename) self.assert_(not file_item.copy( - '%s%s' % (prefix, Utils.create_name()), - Utils.create_name())) + '%s%s' % (prefix, Utils.create_name()), + Utils.create_name())) def testCopyNoDestinationHeader(self): source_filename = Utils.create_name() @@ -996,8 +996,8 @@ class TestFile(Base): dest_filename = Utils.create_name() file_item = cont.file(dest_filename) - file_item.write(hdrs={'X-Copy-From': '%s%s/%s' % (prefix, - self.env.container.name, source_filename)}) + file_item.write(hdrs={'X-Copy-From': '%s%s/%s' % ( + prefix, self.env.container.name, source_filename)}) self.assert_(dest_filename in cont.files())