ó
\c           @@  s†   d  Z  d d l m Z d d l Z d d l Z d d l j j Z	 d d l
 m Z m Z d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d S(
   s0   
    Tests for the (internal) selections module
i    (   t   absolute_importNi   (   t   TestCaset   utt   TestTypeGenerationc           B@  s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   sU   
        Internal feature: Determine output types from dataset dtype and fields.
    c         C@  sT   t  j d ƒ } t j | d ƒ \ } } |  j | | ƒ |  j | t  j d ƒ ƒ d S(   s.    Non-compound types are handled appropriately t   iN(    (   t   npt   dtypet   selt   read_dtypest   assertEqual(   t   selft   dtt   outt   format(    (    s=   lib/python2.7/site-packages/h5py/tests/old/test_selections.pyt   test_simple   s    c         C@  sA   t  j d ƒ } |  j t ƒ  t j | d ƒ \ } } Wd QXd S(   s3    Field names for non-field types raises ValueError R   t   aN(   R   (   R   R   t   assertRaisest
   ValueErrorR   R   (   R
   R   R   R   (    (    s=   lib/python2.7/site-packages/h5py/tests/old/test_selections.pyt   test_simple_fieldexc#   s    c         C@  sè   t  j d d	 d
 g ƒ } t j | d ƒ \ } } |  j | | ƒ |  j | | ƒ t j | d ƒ \ } } |  j | | ƒ |  j | t  j d d g ƒ ƒ t j | d ƒ \ } } |  j | t  j d ƒ ƒ |  j | t  j d g ƒ ƒ d S(   s(    Compound types with elemental subtypes R   R   t   bt   ft   cs   |S10N(   R   R   (   R   R   (   R   s   |S10(    (   R   R   (   R   R   (   R   R   (   R   (   R   R   (   R   R   R   R   R	   (   R
   R   R   R   (    (    s=   lib/python2.7/site-packages/h5py/tests/old/test_selections.pyt   test_compound_simple)   s    (   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    s=   lib/python2.7/site-packages/h5py/tests/old/test_selections.pyR      s   		t   TestScalarSliceRulesc           B@  s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   sD   
        Internal feature: selections rules for scalar datasets
    c         C@  s:   t  j |  j ƒ  d ƒ |  _ |  j j d d ƒ j |  _ d  S(   Nt   wt   x(    (   t   h5pyt   Filet   mktempR   t   create_datasett   idt   dsid(   R
   (    (    s=   lib/python2.7/site-packages/h5py/tests/old/test_selections.pyt   setUpC   s    c         C@  s   |  j  r |  j  j ƒ  n  d  S(   N(   R   t   close(   R
   (    (    s=   lib/python2.7/site-packages/h5py/tests/old/test_selections.pyt   tearDownG   s    	c         C@  sº   t  j |  j d ƒ \ } } |  j | d ƒ |  j | j ƒ  d ƒ t  j |  j t f ƒ \ } } |  j | d ƒ |  j | j ƒ  d ƒ |  j t ƒ   t  j |  j d ƒ \ } } Wd QXd S(   s*    Permissible arguments for scalar slicing i   N(    (    (   i   (	   R   t   read_selections_scalarR"   R	   t   Nonet   get_select_npointst   EllipsisR   R   (   R
   t   shapet	   selection(    (    s=   lib/python2.7/site-packages/h5py/tests/old/test_selections.pyt	   test_argsK   s    (   R   R   R   R#   R%   R,   (    (    (    s=   lib/python2.7/site-packages/h5py/tests/old/test_selections.pyR   =   s   		(   R   t
   __future__R    t   numpyR   R   t   h5py._hl.selections2t   _hlt   selections2R   t   commonR   R   R   R   (    (    (    s=   lib/python2.7/site-packages/h5py/tests/old/test_selections.pyt   <module>   s   '