U
    ‰dw  ã                   @   s2   d dl mZmZmZ d dlZG dd„ dejƒZdS )é    )ÚcoreÚutilsÚ	test_utilNc                   @   s   e Zd Zdd„ Zdd„ ZdS )Ú	TestUtilsc                 C   s˜   t  dd¡t  dd¡t  dd¡t  dt ddg¡¡t  d	t d
dg¡¡t  dt ddg¡¡g}t  |¡}dddddgd
dgddgdœ}|  ||d¡ d S )NÚint1é   Úfloat1g      @Ústring1ZfooÚintlist1é   Ú
floatlist1g      @g      @Ústringlist1Úbars   foos   bar)r   r   r	   r
   r   r   z6dictionary version of arguments doesn't match original)r   ZMakeArgumentÚnpÚarrayZ
ArgsToDictÚassertEqual)ÚselfÚargsZdict_Úexpected© r   ú</tmp/pip-unpacked-wheel-ua33x9lu/caffe2/python/utils_test.pyÚtestArgsToDict   s     


û
ûzTestUtils.testArgsToDictc                 C   sl   t  d¡}t  d¡}t ||¡ | ¡ jD ]}|  |jjd d¡ q*| ¡ jD ]}|  |jjd d¡ qNd S )NÚinit_netÚnetr   zdevice_type_override:cpu)	r   ZNetr   ZBuildUniqueMutexIterZProtoÚopr   Zdevice_optionZ
extra_info)r   r   r   r   r   r   r   ÚtestBuildUniqueMutexIter   s    

ÿÿz"TestUtils.testBuildUniqueMutexIterN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r      s   r   )Zcaffe2.pythonr   r   r   Znumpyr   ZTestCaser   r   r   r   r   Ú<module>   s   