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
This commit is contained in:
xiulin yin 2017-02-13 10:17:01 +08:00
parent cabc065551
commit 5400658bfd
1 changed files with 13 additions and 0 deletions

View File

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