[Libvirt-cim] [PATCH] [TEST][Addition] : Adding check_len() function to verify the lenght of the association, list etc
Dan Smith
danms at us.ibm.com
Tue Apr 1 14:57:56 UTC 2008
DK> +def check_len(an, assoc_list_info, qcn, crit='eq', exp_len=0):
DK> + if crit == 'ne':
DK> + expr = 'len(assoc_list_info) != exp_len'
DK> + elif crit == 'eq':
DK> + expr = 'len(assoc_list_info) == exp_len'
DK> + elif crit == 'lt':
DK> + expr = 'len(assoc_list_info) < exp_len'
DK> + elif crit == 'gt':
DK> + expr = 'len(assoc_list_info) > exp_len'
DK> + elif crit == 'le':
DK> + expr = 'len(assoc_list_info) <= exp_len'
DK> + else:
DK> + expr = 'len(assoc_list_info) <= exp_len'
DK> + if eval(expr) :
DK> + logger.error("%s returned %i %s objects, as compared with %i" % (an, len(assoc_list_info), qcn, exp_len))
DK> + return FAIL
DK> + return PASS
DK> +
Sorry, but this will not go into the tree. Ever.
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms at us.ibm.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20080401/6637f5aa/attachment.sig>
More information about the Libvirt-cim
mailing list