From 3d09e37aa057d67e8c374cdbdbddf6739ba753bf Mon Sep 17 00:00:00 2001 From: vponomaryov Date: Mon, 7 Jul 2014 18:34:03 +0300 Subject: [PATCH] Fix and enable F811 pep8 rule (redefinitions) Change-Id: I4578a6ee77e2c875fa0be03763a5176fc0075198 Related-Bug: #1333290 --- manilaclient/v1/client.py | 4 ++-- tests/v1/test_shell.py | 4 ++-- tox.ini | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/manilaclient/v1/client.py b/manilaclient/v1/client.py index 9309c35ad..0cc36b0a2 100644 --- a/manilaclient/v1/client.py +++ b/manilaclient/v1/client.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from manilaclient import client +from manilaclient import client as httpclient from manilaclient.v1 import limits from manilaclient.v1 import quota_classes from manilaclient.v1 import quotas @@ -68,7 +68,7 @@ class Client(object): setattr(self, extension.name, extension.manager_class(self)) - self.client = client.HTTPClient( + self.client = httpclient.HTTPClient( username, password, project_id, diff --git a/tests/v1/test_shell.py b/tests/v1/test_shell.py index c0617a94a..2f5efb98e 100644 --- a/tests/v1/test_shell.py +++ b/tests/v1/test_shell.py @@ -440,7 +440,7 @@ class SecretsHelperTestCase(utils.TestCase): return_value='fake_token|fake_url|fake_tenant_id')).start() self.addCleanup(mock.patch.stopall) - def test_validate_string_void_string(self): + def test_validate_string_empty_string(self): self.assertFalse(self.helper._validate_string('')) def test_validate_string_void_string(self): @@ -510,7 +510,7 @@ class SecretsHelperTestCase(utils.TestCase): self.helper = shell.SecretsHelper(self.args, self.cs.client) self.assertIsNone(self.helper.auth_token) - def test_management_url_os_cache_true(self): + def test_auth_token_os_cache_true(self): self.assertEqual(self.helper.auth_token, 'fake_token') expected_key = 'http://111.11.11.11:5000/user/project/region/' \ 'publicURL/share/fake/fake' diff --git a/tox.ini b/tox.ini index d3960ba75..72a7b8b68 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,7 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' downloadcache = ~/cache/pip [flake8] -ignore = F811,F821 +# F821: undefined name +ignore = F821 builtins = _ exclude = .venv,.tox,dist,doc,openstack,*egg