From cabc065551013af2633accb5415bb085774d6da2 Mon Sep 17 00:00:00 2001 From: xiulin yin Date: Mon, 13 Feb 2017 10:29:51 +0800 Subject: [PATCH] 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 --- tricircle/tests/unit/db/test_api.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tricircle/tests/unit/db/test_api.py b/tricircle/tests/unit/db/test_api.py index 62b8d168..1afede11 100644 --- a/tricircle/tests/unit/db/test_api.py +++ b/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())