ó
\c           @@  s^   d  Z  d d l m Z d d l Z d d l Z d d l m Z m Z d e f d     YZ	 d S(   s6   
    Tests the h5py.AttributeManager.create() method.
i    (   t   absolute_importNi   (   t   utt   TestCaset	   TestArrayc           B@  s)   e  Z d  Z d   Z d   Z d   Z RS(   sG   
        Check that top-level array types can be created and read.
    c         C@  sŖ   t  j d  } t  j d d d } |  j j j d d | d | t j j |  j j	 d  } | j
   } |  j | j   t j j  |  j j d } |  j | |  d  S(   Ns   (3,)ii   t   dtypet   it   xt   data(   t   npR   t   aranget   ft   attrst   createt   h5pyt   h5at   opent   idt   get_typet   assertEqualt	   get_classt   h5tt   ARRAYt   assertArrayEqual(   t   selft   dtR   t   aidt   htypet   out(    (    sB   lib/python2.7/site-packages/h5py/tests/hl/test_attribute_create.pyt   test_int   s    c         C@  s#   |  j  j j d d d d d d  S(   NR   R   i*   R   t   i8(   R
   R   R   (   R   (    (    sB   lib/python2.7/site-packages/h5py/tests/hl/test_attribute_create.pyt   test_string_dtype,   s    c         C@  sĀ   d } |  j  j j d d | |  j  j d } |  j t | | k   |  j | j t j d   t j |  } |  j | j t j d   |  j	 t
   |  j  j j d d | Wd  QXd  S(	   Nu   au   bR   R   t   Ot   U1t   y(   u   au   b(   R
   R   R   t
   assertTruet   allR   R   R   t   arrayt   assertRaisest	   TypeError(   R   R   t   resultt   data_as_U_array(    (    sB   lib/python2.7/site-packages/h5py/tests/hl/test_attribute_create.pyt   test_tuple_of_unicode1   s    (   t   __name__t
   __module__t   __doc__R   R   R)   (    (    (    sB   lib/python2.7/site-packages/h5py/tests/hl/test_attribute_create.pyR      s   		(
   R,   t
   __future__R    t   numpyR   R   t   commonR   R   R   (    (    (    sB   lib/python2.7/site-packages/h5py/tests/hl/test_attribute_create.pyt   <module>   s
   