Add test for flavor

We increased in three patch for flavor-list disk, vcpu, ephemeral,
but did not have a corresponding test to test whether can obtain.
we once have a test by trove/api-ref/source/samples/db-flavors-response.json,
but is not have now, even if I had deleted the file, the test still
can get through it.

Change-Id: Ibe93c975d93158407fefaeeb2e7a48325d03d5b7
This commit is contained in:
jiansong 2016-10-24 04:11:03 -07:00 committed by jian.song
parent efd2ad9ee9
commit 04e95ec25c
1 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,9 @@ class FlavorViewsTest(trove_testtools.TestCase):
self.flavor.name = 'test_flavor'
self.flavor.ram = 512
self.links = 'my_links'
self.flavor.vcpus = '10'
self.flavor.disk = '0'
self.flavor.ephemeral = '0'
def tearDown(self):
super(FlavorViewsTest, self).tearDown()
@ -64,5 +67,12 @@ class FlavorViewsTest(trove_testtools.TestCase):
msg + 'invalid name')
self.assertEqual(self.flavor.ram, result['flavor']['ram'],
msg + 'invalid ram')
self.assertEqual(self.flavor.vcpus, result['flavor']['vcpus'],
msg + 'invalid vcpus')
self.assertEqual(self.flavor.disk, result['flavor']['disk'],
msg + 'invalid disk')
self.assertEqual(self.flavor.ephemeral,
result['flavor']['ephemeral'],
msg + 'invalid ephemeral')
self.assertEqual(self.links, result['flavor']['links'],
msg + 'invalid links')