diff --git a/tricircle/db/api.py b/tricircle/db/api.py index 66e198f0..f0243991 100644 --- a/tricircle/db/api.py +++ b/tricircle/db/api.py @@ -64,11 +64,6 @@ def update_pod(context, pod_id, update_dict): return core.update_resource(context, models.Pod, pod_id, update_dict) -def get_pod_by_pod_id(context, pod_id): - with context.session.begin(): - return core.get_resource(context, models.Pod, pod_id) - - def create_cached_endpoints(context, config_dict): with context.session.begin(): return core.create_resource(context, models.CachedEndpoint, diff --git a/tricircle/tests/unit/db/test_api.py b/tricircle/tests/unit/db/test_api.py index b2c4e989..851dd83e 100644 --- a/tricircle/tests/unit/db/test_api.py +++ b/tricircle/tests/unit/db/test_api.py @@ -256,6 +256,19 @@ class APITest(unittest.TestCase): pod = api.get_pod_by_name(self.context, region_name) self.assertEqual(pod['region_name'], region_name) + def test_get_pod(self): + self._create_pod(0, 'test_az_uuid1') + self._create_pod(1, 'test_az_uuid1') + self._create_pod(2, 'test_az_uuid2') + + pod_id = 'test_pod_uuid_0' + pod = api.get_pod(self.context, pod_id) + self.assertEqual(pod['pod_id'], pod_id) + + pod_id = 'test_pod_uuid_3' + self.assertRaises( + exceptions.ResourceNotFound, api.get_pod, self.context, pod_id) + def test_delete_mappings_by_bottom_id(self): self._create_pod(0, 'test_az_uuid_0') self._create_pod(1, 'test_az_uuid_1')