'list or list_details with given params and validates result.'

def _list_by_param_values_and_assert(self, with_detail=False, **params):

    fetched_snap_list = self.snapshots_client.list_snapshots(detail=with_detail, **params)['snapshots']
    for snap in fetched_snap_list:
        for key in params:
            msg = ('Failed    to    list    snapshots    %s    by    %s' % (('details' if with_detail else ''), key))
            self.assertEqual(params[key], snap[key], msg)
