From 8c01d33666750fc55e25778f6e5b2eb58e107752 Mon Sep 17 00:00:00 2001 From: Andrey Volkov Date: Tue, 24 Nov 2020 13:36:20 +0300 Subject: [PATCH] Remove unused test helper Deleting CreateIncompleteConsumersTestCase._check_incomplete_consumers. It was not fully cleaned up by I5a29685d1e22c66e4d09f04198c011e71340a5d0. Change-Id: I17aed41eb05f6ae5a83f97058931b2fb003bfad6 --- .../tests/functional/db/test_consumer.py | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/placement/tests/functional/db/test_consumer.py b/placement/tests/functional/db/test_consumer.py index 3a6c8abe2..982b2093f 100644 --- a/placement/tests/functional/db/test_consumer.py +++ b/placement/tests/functional/db/test_consumer.py @@ -141,43 +141,6 @@ class CreateIncompleteConsumersTestCase( super(CreateIncompleteConsumersTestCase, self).setUp() self.ctx = self.context - @db_api.placement_context_manager.reader - def _check_incomplete_consumers(self, ctx): - config = ctx.config - incomplete_project_id = config.placement.incomplete_consumer_project_id - - # Verify we have a record in projects for the missing sentinel - sel = PROJECT_TBL.select( - PROJECT_TBL.c.external_id == incomplete_project_id) - rec = ctx.session.execute(sel).first() - self.assertEqual(incomplete_project_id, rec['external_id']) - incomplete_proj_id = rec['id'] - - # Verify we have a record in users for the missing sentinel - incomplete_user_id = config.placement.incomplete_consumer_user_id - sel = user_obj.USER_TBL.select( - USER_TBL.c.external_id == incomplete_user_id) - rec = ctx.session.execute(sel).first() - self.assertEqual(incomplete_user_id, rec['external_id']) - incomplete_user_id = rec['id'] - - # Verify there are records in the consumers table for our old - # allocation records created in the pre-migration setup and that the - # projects and users referenced in those consumer records point to the - # incomplete project/user - sel = CONSUMER_TBL.select(CONSUMER_TBL.c.uuid == uuids.c1_missing) - missing_c1 = ctx.session.execute(sel).first() - self.assertEqual(incomplete_proj_id, missing_c1['project_id']) - self.assertEqual(incomplete_user_id, missing_c1['user_id']) - sel = CONSUMER_TBL.select(CONSUMER_TBL.c.uuid == uuids.c2_missing) - missing_c2 = ctx.session.execute(sel).first() - self.assertEqual(incomplete_proj_id, missing_c2['project_id']) - self.assertEqual(incomplete_user_id, missing_c2['user_id']) - - # Ensure there are no more allocations with incomplete consumers - res = _get_allocs_with_no_consumer_relationship(ctx) - self.assertEqual(0, len(res)) - def test_create_incomplete_consumers(self): """Test the online data migration that creates incomplete consumer records along with the incomplete consumer project/user records.