From 827be8fb8cf4508c7ac0488652c4e0e93ec443f5 Mon Sep 17 00:00:00 2001 From: Tang Chen Date: Mon, 11 Apr 2016 16:32:58 +0800 Subject: Move keys() methods in each resource class to FakeResource FakeXXX classes in network don't need to fake any method, except keys(). But keys() can be put in FakeResource since it just returns all attributes in _info. This patch moves removes all unnecessary fake methods code, moves keys() method to FakeResource. This patch also finds out some missing attributes in network and router tests. Change-Id: I799822c8715b9ac4f95b98f8350f196757d79d3e --- openstackclient/tests/fakes.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'openstackclient/tests/fakes.py') diff --git a/openstackclient/tests/fakes.py b/openstackclient/tests/fakes.py index 9fdcc7e9..f0cebb06 100644 --- a/openstackclient/tests/fakes.py +++ b/openstackclient/tests/fakes.py @@ -183,6 +183,9 @@ class FakeResource(object): info = ", ".join("%s=%s" % (k, getattr(self, k)) for k in reprkeys) return "<%s %s>" % (self.__class__.__name__, info) + def keys(self): + return self._info.keys() + class FakeResponse(requests.Response): -- cgit v1.2.1