Browse Source

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
changes/15/432815/3
xiulin yin 6 years ago
parent
commit
cabc065551
  1. 9
      tricircle/tests/unit/db/test_api.py

9
tricircle/tests/unit/db/test_api.py

@ -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())

Loading…
Cancel
Save