Add volume to fake snapshot object
Updating fake_snapshot.fake_snapshot_obj() to set the volume attribute. Change-Id: Ia9ccc20cdbbce8d56861b58cf73583b6fb206e16
This commit is contained in:
parent
7502e1fed3
commit
038fddaab5
|
@ -49,7 +49,9 @@ def fake_db_snapshot(**updates):
|
|||
|
||||
|
||||
def fake_snapshot_obj(context, **updates):
|
||||
expected_attrs = updates.pop('expected_attrs', None)
|
||||
expected_attrs = updates.pop('expected_attrs', None) or []
|
||||
if 'volume' in updates and 'volume' not in expected_attrs:
|
||||
expected_attrs.append('volume')
|
||||
return snapshot.Snapshot._from_db_object(context, snapshot.Snapshot(),
|
||||
fake_db_snapshot(**updates),
|
||||
expected_attrs=expected_attrs)
|
||||
|
|
|
@ -200,7 +200,7 @@ class NotifyUsageTestCase(test.TestCase):
|
|||
expected_snapshot = {
|
||||
'tenant_id': fake.PROJECT_ID,
|
||||
'user_id': fake.USER_ID,
|
||||
'availability_zone': '',
|
||||
'availability_zone': 'nova',
|
||||
'volume_id': fake.VOLUME_ID,
|
||||
'volume_size': 1,
|
||||
'snapshot_id': fake.SNAPSHOT_ID,
|
||||
|
|
Loading…
Reference in New Issue