[cloudstack] add list_snapshots request mock

This commit is contained in:
dm1try 2013-04-20 22:41:58 +03:00
parent 6e2bc6d6c3
commit e85f6688b1
1 changed files with 21 additions and 0 deletions

View File

@ -15,6 +15,27 @@ module Fog
end
end
class Mock
def list_snapshots(options={})
snapshot_id = options.delete('id')
if snapshot_id
snapshots = [self.data[:snapshots][snapshot_id]]
else
snapshots = self.data[:snapshots].values
end
{
'listsnapshotsresponse' => {
'count' => snapshots.size,
'snapshot' => snapshots
}
}
end
end
end
end
end