From dacf0df9957afebea3fa546a9ae3341bd7910721 Mon Sep 17 00:00:00 2001 From: Tom Barron Date: Fri, 1 Apr 2016 19:30:02 -0400 Subject: [PATCH] Fix uuid warnings from test_db_api unit tests The test_db_api unit tests emit FutureWarnings [1] from oslo_versioned_objects due to use of invalid faked test values. This commit uses fake values from cinder/tests/unit/fake_constants.py to clean up these warnings consistent with other similar cleanups in the codebase. [1] http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField Change-Id: Ib0b38bac57a62ffbb0e71729193efc7039956a35 --- cinder/tests/unit/test_db_api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cinder/tests/unit/test_db_api.py b/cinder/tests/unit/test_db_api.py index 87b658b62..283108060 100644 --- a/cinder/tests/unit/test_db_api.py +++ b/cinder/tests/unit/test_db_api.py @@ -29,7 +29,7 @@ from cinder import exception from cinder import objects from cinder import quota from cinder import test -from cinder.tests.unit import fake_constants +from cinder.tests.unit import fake_constants as fake THREE = 3 THREE_HUNDREDS = 300 @@ -1968,8 +1968,8 @@ class DBAPIBackupTestCase(BaseTest): def _get_values(self, one=False): base_values = { - 'user_id': 'user', - 'project_id': 'project', + 'user_id': fake.USER_ID, + 'project_id': fake.PROJECT_ID, 'volume_id': 'volume', 'host': 'host', 'availability_zone': 'zone', @@ -2013,9 +2013,9 @@ class DBAPIBackupTestCase(BaseTest): self._assertEqualObjects(backup, backup_get) def test_backup_get_deleted(self): - backup_dic = {'user_id': 'user', - 'project_id': 'project', - 'volume_id': fake_constants.volume_id, + backup_dic = {'user_id': fake.USER_ID, + 'project_id': fake.PROJECT_ID, + 'volume_id': fake.VOLUME_ID, 'size': 1, 'object_count': 1} backup = objects.Backup(self.ctxt, **backup_dic)