From e3e2f4d397f7176e5be8add3e1edd824520a028a Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Wed, 23 Aug 2017 14:18:01 -0400 Subject: [PATCH] Fix method/module redefinition errors These are caught by F811, but that test is currently disabled because it fails on @api_versions.wraps() decorated methods. Just clean up these errors for now. Change-Id: I42aed024352f798ebafddeb6f12880d8726360fe --- cinderclient/tests/unit/test_client.py | 1 - cinderclient/tests/unit/v3/fakes.py | 9 ++------- cinderclient/tests/unit/v3/test_services.py | 5 ----- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/cinderclient/tests/unit/test_client.py b/cinderclient/tests/unit/test_client.py index 4b341b23e..63735c836 100644 --- a/cinderclient/tests/unit/test_client.py +++ b/cinderclient/tests/unit/test_client.py @@ -25,7 +25,6 @@ import six from cinderclient import api_versions import cinderclient.client from cinderclient import exceptions -from cinderclient import utils import cinderclient.v1.client import cinderclient.v2.client diff --git a/cinderclient/tests/unit/v3/fakes.py b/cinderclient/tests/unit/v3/fakes.py index da240f3aa..9fd614abe 100644 --- a/cinderclient/tests/unit/v3/fakes.py +++ b/cinderclient/tests/unit/v3/fakes.py @@ -372,7 +372,8 @@ class FakeHTTPClient(fake_v2.FakeHTTPClient): if action == 'delete': assert 'delete-volumes' in body[action] elif action in ('enable_replication', 'disable_replication', - 'failover_replication', 'list_replication_targets'): + 'failover_replication', 'list_replication_targets', + 'reset_status'): assert action in body else: raise AssertionError("Unexpected action: %s" % action) @@ -418,9 +419,6 @@ class FakeHTTPClient(fake_v2.FakeHTTPClient): def put_group_snapshots_1234(self, **kw): return (200, {}, {'group_snapshot': {}}) - def post_groups_1234_action(self, **kw): - return (202, {}, {}) - def get_groups_5678(self, **kw): return (200, {}, {'group': _stub_group(id='5678')}) @@ -446,9 +444,6 @@ class FakeHTTPClient(fake_v2.FakeHTTPClient): def post_group_snapshots_5678_action(self, **kw): return (202, {}, {}) - def get_group_snapshots_5678(self, **kw): - return (200, {}, {'group_snapshot': _stub_group_snapshot(id='5678')}) - def delete_group_snapshots_1234(self, **kw): return (202, {}, {}) diff --git a/cinderclient/tests/unit/v3/test_services.py b/cinderclient/tests/unit/v3/test_services.py index 14d89405f..5bb3140e6 100644 --- a/cinderclient/tests/unit/v3/test_services.py +++ b/cinderclient/tests/unit/v3/test_services.py @@ -22,11 +22,6 @@ from cinderclient.tests.unit.v3 import fakes class ServicesTest(utils.TestCase): - def test_api_version(self): - client = fakes.FakeClient(version_header='3.0') - svs = client.services.server_api_version() - [self.assertIsInstance(s, services.Service) for s in svs] - def test_list_services_with_cluster_info(self): cs = fakes.FakeClient(api_version=api_versions.APIVersion('3.7')) services_list = cs.services.list()