[Freeipa-devel] [PATCH] ipatests: port of p11helper test from github

Milan Kubik mkubik at redhat.com
Tue Mar 17 09:38:54 UTC 2015


Hi,

On 03/16/2015 05:23 PM, Martin Basti wrote:
> On 16/03/15 15:32, Milan Kubik wrote:
>> On 03/16/2015 12:03 PM, Milan Kubik wrote:
>>> On 03/13/2015 02:59 PM, Milan Kubik wrote:
>>>> Hi,
>>>>
>>>> this is a patch with port of [1] to pytest.
>>>>
>>>> [1]: 
>>>> https://github.com/spacekpe/freeipa-pkcs11/blob/master/python/run.py
>>>>
>>>> Cheers,
>>>> Milan
>>>>
>>>>
>>>>
>>> Added few more asserts in methods where the test could fail and 
>>> cause other errors.
>>>
>>>
>> New version of the patch after brief discussion with Martin Basti. 
>> Removed unnecessary variable assignments and separated a new test case.
>>
>>
> Hello,
>
> thank you for the patch.
> I have a few nitpicks:
> 1)
> You can remove this and use just hexlify(s)
> +def str_to_hex(s):
> +    return ''.join("{:02x}".format(ord(c)) for c in s)
done
>
> 2)
> + def test_find_secret_key(self, p11):
> +     assert p11.find_keys(_ipap11helper.KEY_CLASS_SECRET_KEY, 
> label=u"žžž-aest")
>
> In tests before you tested the exact number of expected IDs returned 
> by find_keys method, why not here?
Lack of attention.
Fixed the assert in `test_search_for_master_key` which does the same 
thing. Merged `test_find_secret_key` with `test_search_for_master_key` 
where it belongs.
>
> Martin^2

Milan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20150317/ad6665cd/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-mkubik-0001-4-ipatests-port-of-p11helper-test-from-github.patch
Type: text/x-patch
Size: 11533 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20150317/ad6665cd/attachment.bin>


More information about the Freeipa-devel mailing list