ó
\c           @@  s¸   d  Z  d d l m Z d d l Z d d l m Z d d l m Z m Z m	 Z	 d d l
 Z d d l Z d d l Z d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d e f d „  ƒ  YZ d S(   sv   
    Common high-level operations test

    Tests features common to all high-level objects, like the .name property.
i    (   t   absolute_importN(   t   Filei   (   t   utt   TestCaset   UNICODE_FILENAMESt   BaseTestc           B@  s   e  Z d  „  Z d „  Z RS(   c         C@  s   t  |  j ƒ  d ƒ |  _ d  S(   Nt   w(   R   t   mktempt   f(   t   self(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyt   setUp   s    c         C@  s   |  j  r |  j  j ƒ  n  d  S(   N(   R   t   close(   R	   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyt   tearDown    s    	(   t   __name__t
   __module__R
   R   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyR      s   	t   TestNamec           B@  s   e  Z d  Z d „  Z RS(   s>   
        Feature: .name attribute returns the object name
    c         C@  s)   |  j  j d ƒ } |  j | j d ƒ d S(   s"    Anonymous objects have name None N(   R   t   create_groupt   Nonet   assertIst   name(   R	   t   grp(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyt   test_anonymous*   s    (   R   R   t   __doc__R   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyR   $   s   t   TestReprc           B@  sj   e  Z d  Z e j d ƒ e j d ƒ Z d „  Z d „  Z d „  Z d „  Z	 e
 j e d ƒ d „  ƒ Z RS(	   s7   
        repr() works correctly with Unicode names
    iü   iß   c         C@  s?   t  j r" |  j t | ƒ t ƒ n |  j t | ƒ t  j ƒ d  S(   N(   t   sixt   PY2t   assertIsInstancet   reprt   bytest	   text_type(   R	   t   obj(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyt   _check_type7   s    	c         C@  s&   |  j  j |  j ƒ } |  j | ƒ d S(   s    Group repr() with unicode N(   R   R   t   USTRINGR   (   R	   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyt
   test_group=   s    c         C@  s)   |  j  j |  j d ƒ } |  j | ƒ d S(   s    Dataset repr() with unicode i   N(   i   (   R   t   create_datasetR    R   (   R	   t   dset(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyt   test_datasetB   s    c         C@  s4   t  j d ƒ |  j d <|  j d } |  j | ƒ d S(   s     Named type repr() with unicode R   t   typeN(   t   npt   dtypeR   R   (   R	   t   typ(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyt   test_namedtypeG   s    s#   Filesystem unicode support requiredc         C@  sl   t  j |  j d ƒ } z) t | d ƒ  } |  j | ƒ Wd QXWd y t j | ƒ Wn t k
 rf n XXd S(   s!    File object repr() with unicode u   .hdf5R   N(   t   tempfileR   R    R   R   t   ost   unlinkt	   Exception(   R	   t   fnameR   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyt	   test_fileM   s    (   R   R   R   R   t   unichrR    R   R!   R$   R)   R   t   skipIfR   R/   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyR   /   s   				(   R   t
   __future__R    R   t   h5pyR   t   commonR   R   R   t   numpyR&   R+   R*   R   R   R   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_base.pyt   <module>   s   	