From f536fdd8f3dfda9260624902c385a31935e1cfc7 Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Wed, 26 Jan 2011 10:51:08 -0600 Subject: [PATCH] PEP8 cleanup --- doc/source/conf.py | 4 ++-- tests/stubs.py | 5 +++-- tests/unit/test_clients.py | 6 +++--- tests/unit/test_stores.py | 7 +++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index e6dcd556b2..95897d8fd3 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -118,9 +118,9 @@ pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. modindex_common_prefix = ['glance.'] -# -- Options for man page output ----------------------------------------------- +# -- Options for man page output ---------------------------------------------- -# Grouping the document tree for man pages. +# Grouping the document tree for man pages. # List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual' man_pages = [ diff --git a/tests/stubs.py b/tests/stubs.py index d0d00f1734..e4fef6b075 100644 --- a/tests/stubs.py +++ b/tests/stubs.py @@ -117,6 +117,7 @@ def stub_out_s3_backend(stubs): class FakeSwiftAuth(object): pass + class FakeS3Connection(object): pass @@ -134,8 +135,8 @@ def stub_out_s3_backend(stubs): def chunk_it(): for i in xrange(0, len(cls.DATA), cls.CHUNK_SIZE): - yield cls.DATA[i:i+cls.CHUNK_SIZE] - + yield cls.DATA[i:i + cls.CHUNK_SIZE] + return chunk_it() fake_swift_backend = FakeS3Backend() diff --git a/tests/unit/test_clients.py b/tests/unit/test_clients.py index 5bd433f7cb..977be9efc3 100644 --- a/tests/unit/test_clients.py +++ b/tests/unit/test_clients.py @@ -388,7 +388,7 @@ class TestClient(unittest.TestCase): 'is_public': True, 'type': 'kernel' } - + image_meta = self.client.add_image(fixture) self.assertEquals('queued', image_meta['status']) self.assertEquals(0, image_meta['size']) @@ -401,7 +401,7 @@ class TestClient(unittest.TestCase): 'size': 19, 'location': "file:///tmp/glance-tests/2", } - + new_image = self.client.add_image(fixture) new_image_id = new_image['id'] @@ -434,7 +434,7 @@ class TestClient(unittest.TestCase): 'location': "file:///tmp/glance-tests/2", 'properties': {'distro': 'Ubuntu 10.04 LTS'} } - + new_image = self.client.add_image(fixture) new_image_id = new_image['id'] diff --git a/tests/unit/test_stores.py b/tests/unit/test_stores.py index 24c02d3f30..b281c43353 100644 --- a/tests/unit/test_stores.py +++ b/tests/unit/test_stores.py @@ -96,17 +96,16 @@ class TestS3Backend(TestBackend): def test_get(self): s3_uri = "s3://user:password@localhost/bucket1/file.tar.gz" - expected_returns = ['I ', 'am', ' a', ' t', 'ea', 'po', 't,', ' s', + expected_returns = ['I ', 'am', ' a', ' t', 'ea', 'po', 't,', ' s', 'ho', 'rt', ' a', 'nd', ' s', 'to', 'ut', '\n'] - fetcher = get_from_backend(s3_uri, - expected_size=8, + fetcher = get_from_backend(s3_uri, + expected_size=8, conn_class=S3Backend) chunks = [c for c in fetcher] self.assertEqual(chunks, expected_returns) - class TestSwiftBackend(TestBackend): def setUp(self):