'list snapshots by sort param'

def _list_snapshots_param_sort(self, sort_key, sort_dir):

    snap_list = self.snapshots_client.list_snapshots(sort_key=sort_key, sort_dir=sort_dir)['snapshots']
    self.assertNotEmpty(snap_list)
    if (sort_key is 'display_name'):
        sort_key = 'name'
    sorted_list = [snapshot[sort_key] for snapshot in snap_list]
    msg = 'The    list    of    snapshots    was    not    sorted    correctly.'
    self.assertEqual(sorted(sorted_list, reverse=(sort_dir == 'desc')), sorted_list, msg)
