Merge pull request #1 from kshileev/master

add list_flavor with GET /flavors without detail
This commit is contained in:
Andrey Brindeyev 2011-05-20 10:52:33 -07:00
commit 0a3f94adbc
2 changed files with 14 additions and 0 deletions

@ -28,6 +28,14 @@ class FlavorManager(base.ManagerWithFind):
:rtype: list of :class:`Flavor`.
"""
return self._list("/flavors/detail", "flavors")
def list_undetailed(self):
"""
Get a list of all flavors.
:rtype: list of :class:`Flavor`.
"""
return self._list("/flavors", "flavors")
def get(self, flavor):
"""

@ -12,6 +12,12 @@ def test_list_flavors():
[assert_isinstance(f, Flavor) for f in fl]
def test_list_flavors_undetailed():
fl = cs.flavors.list_undetailed()
cs.assert_called('GET', '/flavors')
[assert_isinstance(f, Flavor) for f in fl]
def test_get_flavor_details():
f = cs.flavors.get(1)
cs.assert_called('GET', '/flavors/1')