diff options
author | Lingxian Kong <anlin.kong@gmail.com> | 2020-04-18 23:04:09 +1200 |
---|---|---|
committer | Lingxian Kong <anlin.kong@gmail.com> | 2020-04-27 07:04:05 +1200 |
commit | 910519127d8fb9880863eb219df68a574d00df6a (patch) | |
tree | aef0379b2475e876e3f1ff68270b26b13db10244 /trove/tests/util | |
parent | feb982547afe26be4e885b75d82fa5d51a784c0e (diff) | |
download | trove-910519127d8fb9880863eb219df68a574d00df6a.tar.gz |
Remove flavor API
Uses should get flavor from Nova.
Change-Id: Id26d71811f94cdcf4ff188c021d4ed5613eeb8cd
Diffstat (limited to 'trove/tests/util')
-rw-r--r-- | trove/tests/util/client.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/trove/tests/util/client.py b/trove/tests/util/client.py index 106da2b2..3501ecfc 100644 --- a/trove/tests/util/client.py +++ b/trove/tests/util/client.py @@ -67,37 +67,6 @@ class TestClient(object): resp, body = self.real_client.client.last_response return resp.status - @staticmethod - def find_flavor_self_href(flavor): - self_links = [link for link in flavor.links if link['rel'] == 'self'] - asserts.assert_true(len(self_links) > 0, "Flavor had no self href!") - flavor_href = self_links[0]['href'] - asserts.assert_false(flavor_href is None, - "Flavor link self href missing.") - return flavor_href - - def find_flavors_by(self, condition, flavor_manager=None): - flavor_manager = flavor_manager or self.flavors - flavors = flavor_manager.list() - return [flavor for flavor in flavors if condition(flavor)] - - def find_flavors_by_name(self, name, flavor_manager=None): - return self.find_flavors_by(lambda flavor: flavor.name == name, - flavor_manager) - - def find_flavors_by_ram(self, ram, flavor_manager=None): - return self.find_flavors_by(lambda flavor: flavor.ram == ram, - flavor_manager) - - def find_flavor_and_self_href(self, flavor_id, flavor_manager=None): - """Given an ID, returns flavor and its self href.""" - flavor_manager = flavor_manager or self.flavors - asserts.assert_false(flavor_id is None) - flavor = flavor_manager.get(flavor_id) - asserts.assert_false(flavor is None) - flavor_href = self.find_flavor_self_href(flavor) - return flavor, flavor_href - def __getattr__(self, item): if item == "__setstate__": raise AttributeError(item) |