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
This commit is contained in:
parent
2b330c02c3
commit
dacf0df995
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user