[Libvirt-cim] [PATCH] [TEST] Updating VSMC 01_enum.py to verify the SynchronousMethodsSupported values

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Sep 3 17:00:40 UTC 2008


Deepti B Kalakeri wrote:
> 
> 
> Kaitlin Rupert wrote:
>>>
>>> +    try:
>>> +        if len(vsmc) != 1:
>>> +            logger.error("'%s' returned '%d' instance, excepted only 
>>> 1", cn, len(vsmc))
>>
>> This line wraps.
> Can I get more details here ?

This line and the next line are both longer than 80 characters.

>>
>>> +            return FAIL
>>> + +        if vsmc[0].InstanceID != "ManagementCapabilities":
>>> +            print_field_error('InstanceID', vsmc[0].InstanceID, 
>>> 'ManagementCapabilities')
>>
>> This line wraps as well.
>>
>>> +            return FAIL
>>>
>>> +        vsmc_sync_val = Set(vsmc[0].SynchronousMethodsSupported)
>>> +        if len(vsmc_sync_val - sync_method_val) != 0:
>>> +            print_field_error('SynchronousMethodsSupported', 
>>> vsmc_sync_val, +                               sync_method_val)
>>> +            return FAIL
>>
>> In addition to also checking the len, you'll want to check to make 
>> sure the SynchronousMethodsSupported values match the values we're 
>> expecting.
> 
> The above check len(vsmc_sync_val - sync_method_val)
> 1) Verifies the len
> 2) Also if the values in the list differ then difference will be greater 
> than zero which means the list values does not match.
> Well, I had initially done 2 check one for verifying the len of the list 
> and the other for verifying the values.
> But since the operation S1 - S2 did both of them I switched to the above 
> option.
> 
> Let me know if you still think separating the both is good then I can do 
> so.
> 

You're correct.  Sorry, I'd forgotten that you were using sets to 
compare the two values.  No need to break this into 2 different checks.

Thanks!

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list