Add get top pod unit test case

1. What is the problem
Tricircle does not have get top pod test case

2. What is the solution to the problem
Implement related test case

3. What the features need to be implemented to the Tricircle
No new features

Change-Id: I5c48c67095733823c14ab8a8dca87838b0aa2541
This commit is contained in:
xiulin yin 2017-02-13 10:29:51 +08:00
parent 4a632c536c
commit cabc065551
1 changed files with 9 additions and 0 deletions

View File

@ -217,5 +217,14 @@ class APITest(unittest.TestCase):
api.find_pod_by_az_or_region,
self.context, az_region)
def test_get_top_pod(self):
self._create_pod(0, '')
self._create_pod(1, 'test_az_uuid1')
self._create_pod(2, 'test_az_uuid2')
pod = api.get_top_pod(self.context)
self.assertEqual(pod['region_name'], 'test_pod_0')
self.assertEqual(pod['az_name'], '')
def tearDown(self):
core.ModelBase.metadata.drop_all(core.get_engine())