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:
parent
efd2ad9ee9
commit
04e95ec25c
|
@ -29,6 +29,9 @@ class FlavorViewsTest(trove_testtools.TestCase):
|
||||||
self.flavor.name = 'test_flavor'
|
self.flavor.name = 'test_flavor'
|
||||||
self.flavor.ram = 512
|
self.flavor.ram = 512
|
||||||
self.links = 'my_links'
|
self.links = 'my_links'
|
||||||
|
self.flavor.vcpus = '10'
|
||||||
|
self.flavor.disk = '0'
|
||||||
|
self.flavor.ephemeral = '0'
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
super(FlavorViewsTest, self).tearDown()
|
super(FlavorViewsTest, self).tearDown()
|
||||||
|
@ -64,5 +67,12 @@ class FlavorViewsTest(trove_testtools.TestCase):
|
||||||
msg + 'invalid name')
|
msg + 'invalid name')
|
||||||
self.assertEqual(self.flavor.ram, result['flavor']['ram'],
|
self.assertEqual(self.flavor.ram, result['flavor']['ram'],
|
||||||
msg + 'invalid 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'],
|
self.assertEqual(self.links, result['flavor']['links'],
|
||||||
msg + 'invalid links')
|
msg + 'invalid links')
|
||||||
|
|
Loading…
Reference in New Issue