Browse Source

Add get pod by region unit test case

1. What is the problem
Tricircle does not have get pod by region name 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: I2d0f529d465e29c75169091ac6c95e5368d7e57b
changes/12/432812/4
xiulin yin 6 years ago
parent
commit
5400658bfd
  1. 13
      tricircle/tests/unit/db/test_api.py

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

@ -226,5 +226,18 @@ class APITest(unittest.TestCase):
self.assertEqual(pod['region_name'], 'test_pod_0')
self.assertEqual(pod['az_name'], '')
def test_get_pod_by_region(self):
self._create_pod(0, 'test_az_uuid1')
self._create_pod(1, 'test_az_uuid1')
self._create_pod(2, 'test_az_uuid2')
region_name = 'test_pod_3'
pod = api.get_pod_by_name(self.context, region_name)
self.assertIsNone(pod)
region_name = 'test_pod_0'
pod = api.get_pod_by_name(self.context, region_name)
self.assertEqual(pod['region_name'], region_name)
def tearDown(self):
core.ModelBase.metadata.drop_all(core.get_engine())

Loading…
Cancel
Save