
j\c           @@ s  d  Z  d d l m Z d d l m Z d d l Z d d l Z d d l Z d d l m Z d d l	 Z	 d d l
 m Z m Z d d l Z d d l m Z m Z m Z m Z m Z m Z m Z d d l m Z d d	 l m Z d d
 l m Z d d l m Z m Z d d l m Z d d l  m! Z! d e f d     YZ" d e j# e f d     YZ$ d e$ f d     YZ% d e$ f d     YZ& d e$ f d     YZ' d e$ f d     YZ( d e$ f d     YZ) d e$ f d     YZ* d e j# e f d     YZ+ d  e+ f d!     YZ, d" e+ f d#     YZ- d$ e+ f d%     YZ. d& e+ f d'     YZ/ d( e+ f d)     YZ0 d* e+ f d+     YZ1 d, e j# e f d-     YZ2 d. e2 f d/     YZ3 d0 e2 f d1     YZ4 d2 e j5 e f d3     YZ6 d4 e j5 e f d5     YZ7 d6 e j# e f d7     YZ8 d8 e j# e f d9     YZ9 d: e f d;     YZ: d< e j5 e f d=     YZ; d> e j# e f d?     YZ< d@   Z= e> dA k re j? e j@  e jA   e jB dB dC  n  d S(D   sI   This test unit checks node attributes that are persistent (AttributeSet).i    (   t   print_function(   t   absolute_importN(   t   LooseVersion(   t   assert_array_equalt   assert_almost_equal(   t   IsDescriptiont	   Int32Atomt	   StringColt   IntColt   Int16Colt   FloatColt
   Float32Col(   t   DataTypeWarning(   t   NODE_CACHE_SLOTS(   t   common(   t   unittestt   test_filename(   t   PyTablesTestCase(   t   ranget   Recordc           B@ s;   e  Z e d  d  Z e   Z e   Z e   Z	 e
   Z RS(   t   itemsizei   (   t   __name__t
   __module__R   t   var1R   t   var2R	   t   var3R
   t   var4R   t   var5(    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR      s
   			t   CreateTestCasec           B@ s  e  Z d    Z d   Z d   Z d   Z d d  Z d   Z d   Z d   Z	 d	   Z
 d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e j e j d d k  d  d    Z RS(   c         C@ s   t  t |   j   |  j j |  _ |  j j |  j d t d  |  _ |  j j |  j d d g d  |  _	 |  j j
 |  j d d  |  _ d  S(   Nt   atables   Table titlet   anarrayi   s   Array titlet   agroups   Group title(   t   superR   t   setUpt   h5filet   roott   create_tableR   t   tablet   create_arrayt   arrayt   create_groupt   group(   t   self(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR!   #   s    c         C@ s/  d } |  j  j |  j j d d |  |  j  j |  j j d d |  |  j  j |  j j d d |  |  j r t j r t	 d  n  |  j
 d d d	 |  j  |  j  j |  _ n  |  j |  j  j |  j j d  d |  |  j |  j  j |  j j d  d |  |  j |  j  j |  j j d  d |  d
 S(   s7   Checking setting large string attributes (File methods)i   t   attr1t   pt   at   ns   (closing file version)t   modes   r+t   node_cache_slotsN(   R"   t   set_node_attrR#   R   R   R   t   closeR   t   verboset   printt   _reopenR0   t   assertEqualt   get_node_attr(   R*   t
   attrlength(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test01_setAttributes1   s       		c         C@ sN   |  j  rJ t j r t d  n  |  j d d d |  j  |  j j |  _ n  d  S(   Ns   (closing file version)R/   s   r+R0   (   R2   R   R3   R4   R5   R0   R"   R#   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   reopenK   s
    		c         C@ sb   |  j    |  j | |  j j j k  |  j | |  j j j k  |  j | |  j j j k  d  S(   N(   R:   t   assertFalseR#   R   t   _v_attrsR   t   attrsR   (   R*   t   name(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   check_missingS   s    
t    c         C@ s  |  j  |  |  j j |  j j | |  |  j j |  j j | |  |  j j |  j j | |  |  j   |  j |  j j	 |  j j |  |  |  j |  j j	 |  j j |  |  |  j |  j j	 |  j j |  |  |  j j
 |  j j |  |  j j
 |  j j |  |  j j
 |  j j |  |  j  |  |  j j j | |  |  j j j | |  |  j j j | |  |  j   |  j |  j j j |  |  |  j |  j j j |  |  |  j |  j j j |  |  |  j j j |  |  j j j |  |  j j j |  |  j  |  t |  j j j | |  t |  j j j | |  t |  j j j | |  |  j   |  j t |  j j j |  |  |  j t |  j j j |  |  |  j t |  j j j |  |  t |  j j j |  t |  j j j |  t |  j j j |  |  j  |  | |  j j j | <| |  j j j | <| |  j j j | <|  j   |  j |  j j j | |  |  j |  j j j | |  |  j |  j j j | |  |  j j j | =|  j j j | =|  j j j | =|  j  |  d S(   s*   Check validity of attribute name filteringN(   R?   R"   R1   R#   R   R   R   R:   R6   R7   t   del_node_attrt
   _f_setattrt   set_attrt
   _f_getattrt   get_attrt
   _f_delattrt   del_attrt   setattrR<   R=   t   getattrt   delattr(   R*   R>   t   val(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt
   check_nameZ   sZ    
%%%

"""
c         C@ s   t  j   L t  j d t j  |  j d  |  j d  |  j d  |  j d  Wd QX|  j t |  j d  |  j t |  j d  |  j t |  j d	  d S(
   s!   Checking attribute names validityt   ignoreR-   s   a:bs   /a/bt   .NR@   t   __members__i    (	   t   warningst   catch_warningst   simplefiltert   tablest   NaturalNameWarningRL   t   assertRaisest
   ValueErrort	   TypeError(   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test01a_setAttributes   s    c         C@ s  d } |  j  j j d d |  |  j  j j d d |  |  j  j j d d |  |  j r t j rs t	 d  n  |  j
 d d d	 |  j  |  j j  |  _  n  |  j |  j  j j d  d |  |  j |  j  j j d  d |  |  j |  j  j j d  d |  d
 S(   s7   Checking setting large string attributes (Node methods)i   R+   R,   R-   R.   s   (closing file version)R/   s   r+R0   N(   R#   R   RB   R   RC   R   R2   R   R3   R4   R5   R0   R"   R6   RD   RE   (   R*   R8   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test02_setAttributes   s    		#c         C@ s   d } d | |  j  j _ d | |  j j _ d | |  j j _ |  j r t j r^ t	 d  n  |  j
 d d d |  j  |  j j |  _ n  |  j |  j j j j d |  |  j |  j j j j d |  |  j |  j j j j d |  d	 S(
   s?   Checking setting large string attributes (AttributeSet methods)i   R,   R-   R.   s   (closing file version)R/   s   r+R0   N(   R)   R<   R+   R%   R=   R'   R2   R   R3   R4   R5   R0   R"   R#   R6   R   R   R   (   R*   R8   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test03_setAttributes   s    		  c         C@ s  d |  j  j _ d |  j  j _ d |  j  j _ t j rR t d |  j  j j    n  d |  j	 j
 _ d |  j	 j
 _ d |  j	 j
 _ t j r t d |  j	 j
 j    n  d |  j j
 _ d |  j j
 _ d |  j j
 _ t j r t d |  j j
 j    n  |  j r@t j rt d  n  |  j d d d |  j  |  j j |  _ n  |  j j } |  j | j j d	  d
 d d g  |  j | j j d  d d d g  |  j | j j d  d d d d
 d d g  |  j j } |  j | j
 j   d d d g  |  j | j
 j d  d d d d d d d d d d d d d d g  |  j | j
 j d  d d d d d d d d d d d d d d d d d g  |  j j } |  j | j
 j   d  d! d" g  |  j | j
 j d  d d# d d g  |  j | j
 j d  d d# d d d  d! d" g  d$ S(%   s   Checking listing attributes.t   1t   2t   3s   Attribute list:s   (closing file version)R/   s   r+R0   t   usert   pqt   qrt   rst   syst   CLASSt   TITLEt   VERSIONt   allR-   t   bt   ct   FIELD_0_FILLt   FIELD_0_NAMEt   FIELD_1_FILLt   FIELD_1_NAMEt   FIELD_2_FILLt   FIELD_2_NAMEt   FIELD_3_FILLt   FIELD_3_NAMEt   FIELD_4_FILLt   FIELD_4_NAMEt   NROWSt   it   jt   kt   FLAVORN(   R)   R<   R_   R`   Ra   R   R3   R4   t   _f_listR%   R=   R-   Rh   Rg   R'   Rv   Ru   Rt   R2   R5   R0   R"   R#   R   R6   R   R   (   R*   R   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test04_listAttributes   sn    					%""c         C@ s  d |  j  j _ d |  j  j _ d |  j  j _ |  j  j ` |  j r t j rX t d  n  |  j	 d d d |  j
  |  j j |  _ n  |  j j } t j r t d | j j    n  |  j | j j   d	 d
 g  t j r t d | j j d   n  |  j | j j d  d d d d	 d
 g  | j ` t j rKt d | j j    n  |  j | j j   d
 g  t j rt d | j j    n  |  j | j j d  d d d d
 g  d S(   s   Checking removing attributes.R[   R\   R]   s   (closing file version)R/   s   r+R0   s   Attribute list:R`   Ra   s   Attribute list in disk:Rf   Rc   Rd   Re   N(   R)   R<   R_   R`   Ra   R2   R   R3   R4   R5   R0   R"   R#   R   Rx   R6   (   R*   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test05_removeAttributes  s2    							c         C@ s  d |  j  j _ d |  j  j _ d |  j  j _ |  j j |  j  d  |  j r t j	 rb t
 d  n  |  j d d d |  j  |  j j |  _ n  |  j j } t j	 r t
 d	 | j j    n  |  j | j j   d
 d g  t j	 r t
 d | j j d   n  |  j | j j d  d d d d
 d g  |  j j |  j d
 d  t j	 ret
 d	 | j j    n  |  j | j j   d g  t j	 rt
 d | j j    n  |  j | j j d  d d d d g  d S(   s9   Checking removing attributes (using File.del_node_attr())R[   R\   R]   R_   s   (closing file version)R/   s   r+R0   s   Attribute list:R`   Ra   s   Attribute list in disk:Rf   Rc   Rd   Re   R   N(   R)   R<   R_   R`   Ra   R"   RA   R2   R   R3   R4   R5   R0   R#   R   Rx   R6   (   R*   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test05b_removeAttributes:  s2    						c         C@ s   t  j r, t d  t d |  j j j  n  |  j j ` |  j |  j j j d  d d g  t  j r t d  t d |  j j j  n  d S(   s$   Checking removing system attributes.s   Before removing CLASS attributes   System attrs:Rb   Rd   Re   s   After removing CLASS attributeN(	   R   R3   R4   R)   R<   t   _v_attrnamessysRc   R6   Rx   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test06_removeAttributesa  s    	
	
c         C@ s4  d |  j  j _ d |  j  j _ d |  j  j _ |  j  j j d d  |  j r t j rb t	 d  n  |  j
 d d d	 |  j  |  j j |  _ n  |  j j } t j r t	 d
 | j j    n  |  j | j j   d d d g  t j rt	 d | j j d   n  |  j | j j d  d d d d d d g  d S(   s   Checking renaming attributes.R[   R\   R]   R_   t   ops   (closing file version)R/   s   r+R0   s   Attribute list:R`   Ra   s   Attribute list in disk:Rf   Rc   Rd   Re   N(   R)   R<   R_   R`   Ra   t	   _f_renameR2   R   R3   R4   R5   R0   R"   R#   R   Rx   R6   (   R*   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test07_renameAttributeso  s"    			"	c         C@ s   t  j r, t d  t d |  j j j  n  |  j j j d d  t  j rn t d  t d |  j j j  n  |  j j } |  j	 | j j
 d  d d d g  d	 S(
   s$   Checking renaming system attributes.s   Before renaming CLASS attributes
   All attrs:Rc   R~   s   After renaming CLASS attributeRf   Rd   Re   N(   R   R3   R4   R)   R<   t   _v_attrnamesR   R#   R   R6   Rx   (   R*   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test08_renameAttributes  s    	
	
c         C@ sz  d |  j  j _ d |  j  j _ d |  j  j _ d |  j  j _ d |  j  j _ d d d g |  j  j _ |  j r t j r t d  n  |  j	 d	 d
 d |  j
  |  j j |  _ n  |  j j } t j r t d | j j  n  |  j | j j d  |  j | j j d  |  j | j j d d d g  t j rHt d | j j d   n  |  j | j j d  d d d d d d g  d S(   s    Checking overwriting attributes.R[   R\   R]   t   4i   i   i   s   (closing file version)R/   s   r+R0   s   Value of Attribute pq:s   Attribute list in disk:Rf   Rc   Rd   Re   R_   R`   Ra   N(   R)   R<   R_   R`   Ra   R2   R   R3   R4   R5   R0   R"   R#   R   R6   Rx   (   R*   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test09_overwriteAttributes  s*    				c         C@ sX  d |  j  j _ d |  j  j _ d |  j  j _ |  j  j j |  j j  |  j r t	 j
 re t d  n  |  j d d d |  j  |  j j |  _ n  |  j j } t	 j
 r t d | j j    n  |  j | j j   d	 d
 d g  t	 j
 rt d | j j d   n  |  j | j j d  d d d d d d d d d d d d d d d	 d
 d g  d S(   s   Checking copying attributes.R[   R\   R]   s   (closing file version)R/   s   r+R0   s   Attribute list:R_   R`   Ra   s   Complete attribute list:Rf   Rc   Ri   Rj   Rk   Rl   Rm   Rn   Ro   Rp   Rq   Rr   Rs   Rd   Re   N(   R)   R<   R_   R`   Ra   t   _f_copyR#   R   R2   R   R3   R4   R5   R0   R"   Rx   R6   (   R*   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test10a_copyAttributes  s2    			"	c         C@ s[  d |  j  j _ d |  j  j _ d |  j  j _ |  j j |  j  |  j j  |  j	 r t
 j rh t d  n  |  j d d d |  j  |  j j |  _ n  |  j j } t
 j r t d | j j    n  |  j | j j   d	 d
 d g  t
 j rt d | j j d   n  |  j | j j d  d d d d d d d d d d d d d d d	 d
 d g  d S(   s-   Checking copying attributes (copy_node_attrs)R[   R\   R]   s   (closing file version)R/   s   r+R0   s   Attribute list:R_   R`   Ra   s   Complete attribute list:Rf   Rc   Ri   Rj   Rk   Rl   Rm   Rn   Ro   Rp   Rq   Rr   Rs   Rd   Re   N(   R)   R<   R_   R`   Ra   R"   t   copy_node_attrsR#   R   R2   R   R3   R4   R5   R0   Rx   R6   (   R*   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test10b_copyAttributes  s2    			"	c         C@ s   d |  j  j d <d |  j  j d <|  j j |  j  |  j d  |  j r t j r[ t d  n  |  j	 d d d	 |  j
  |  j j |  _ n  |  j j } t j r t d
 | j j d   n  |  j | j d d  |  j | j d d  d S(   s0   Checking copying attributes during group copies.t   GROUP2Rc   s   1.3Re   t   agroup2s   (closing file version)R/   s   r+R0   s   Complete attribute list:Rf   N(   R)   R<   R"   t	   copy_nodeR#   R2   R   R3   R4   R5   R0   R   Rx   R6   (   R*   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test10c_copyAttributes   s    			c         C@ s   |  j  j } d | j d <d | j d <|  j j | |  j  d  |  j r t j r^ t d  n  |  j	 d d d	 |  j
  |  j j  |  _  n  |  j  j } t j r t d
 | j j d   n  |  j | j d d  |  j | j d d  d S(   s/   Checking copying attributes during leaf copies.t   TABLE2Rc   s   1.3Re   t   atable2s   (closing file version)R/   s   r+R0   s   Complete attribute list:Rf   N(   R#   R   R<   R"   R   R2   R   R3   R4   R5   R0   R   Rx   R6   (   R*   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test10d_copyAttributes  s    			c         C@ s-   |  j  j } d | _ |  j | d d  d S(   s#   Checking the __getitem__ interface.R[   R_   N(   R)   R<   R_   R6   (   R*   R=   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test11a_getitem+  s    	c         C@ s.   |  j  j } d | d <|  j | d d  d S(   s#   Checking the __setitem__ interface.R\   R_   N(   R)   R<   R6   (   R*   R=   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test11b_setitem2  s    
c         C@ s9   |  j  j } d | _ | d =|  j d | j   k  d S(   s#   Checking the __delitem__ interface.R[   R_   N(   R)   R<   R_   t
   assertTrueRx   (   R*   R=   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test11c_delitem9  s    	c         C@ s<   |  j  j } |  j t | j d  |  j t | j d  d S(   s<   Checking that KeyError is raised in __getitem__/__delitem__.R_   N(   R)   R<   RU   t   KeyErrort   __getitem__t   __delitem__(   R*   R=   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test11d_KeyErrorA  s    c         C@ s   t  j d d g d d g g  } | |  j j d <| j j   |  j j d <| j |  j j d <t |  j j d |  t |  j j d | j  t |  j j d | j  d S(	   s7   Checking setting 2D and non-contiguous NumPy attributesi    i   i   i   R-   Rg   Rh   N(   t   numpyR'   R=   t   Tt   copyR   (   R*   t   data(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test_2d_non_contiguousH  s    !i    i   s2   Special method `__dir__()` introduced in Python-3.c         C@ s  t  j r1 t d d d  t d |  j j  n  |  j j } d } d } x | | g D] } d | | <qV Wd } d	 } xD | | g D]6 } t j   " t j	 d
 t
 j  d | | <Wd QXq Wt |  } |  j d |  |  j d |  |  j | j d  d  |  j | |  |  j | |  |  j | j |  d  |  j | |  |  j | |  |  j | j |  d  |  j t t |   t |   d S(   s   Checking AttributeSet.__dir__s   
s   -=i   s   Running %s.test12_dir...t	   good_attrt   BETTER_ATTRi   t   5bads   SYS%RM   Nt	   __class__R   (   R   R3   R4   R   R   R)   R<   RP   RQ   RR   RS   RT   t   dirt   assertInR6   t   countt   assertNotInt   assertSequenceEqualt   sortedt   set(   R*   t   attrsett	   user_attrt   sys_attrR-   t   bad_usert   bad_syst   completions(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt
   test12_dir`  s4    	(   R   R   R!   R9   R:   R?   RL   RX   RY   RZ   Ry   Rz   R{   R}   R   R   R   R   R   R   R   R   R   R   R   R   R   t   skipIfRb   t   version_infoR   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR   "   s2   				<				D	'	'					#	#							t   NotCloseCreatec           B@ s#   e  Z e Z e Z e d  e  Z RS(   R0   (   R   R   t   FalseR2   R   R0   t   dictt   open_kwargs(    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR     s   t   CloseCreatec           B@ s#   e  Z e Z e Z e d  e  Z RS(   R0   (   R   R   t   TrueR2   R   R0   R   R   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR     s   t   NoCacheNotCloseCreatec           B@ s#   e  Z e Z d  Z e d e  Z RS(   i    R0   (   R   R   R   R2   R0   R   R   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR     s   t   NoCacheCloseCreatec           B@ s#   e  Z e Z d  Z e d e  Z RS(   i    R0   (   R   R   R   R2   R0   R   R   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR     s   t   DictCacheNotCloseCreatec           B@ s$   e  Z e Z e Z e d  e  Z RS(   R0   (   R   R   R   R2   R   R0   R   R   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR     s   t   DictCacheCloseCreatec           B@ s$   e  Z e Z e Z e d  e  Z RS(   R0   (   R   R   R   R2   R   R0   R   R   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR     s   t   TypesTestCasec           B@ sL  e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d    Z" d!   Z# d"   Z$ d#   Z% RS($   c         C@ s{   i |  j  d 6|  _ t t |   j   |  j j |  _ |  j j |  j d d g d  |  _ |  j j	 |  j d d  |  _
 d  S(   Nt   allow_paddingR   i   s   Array titleR   s   Group title(   R   R   R    R   R!   R"   R#   R&   R'   R(   R)   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR!     s    c         C@ s&  t  |  j j _ t |  j j _ t  |  j j _ t j r{ t	 d |  j j j  t	 d |  j j j  t	 d |  j j j  n  |  j
 r t j r t	 d  n  |  j d d  |  j j |  _ |  j j j |  _ n  |  j |  j j j j t   |  j |  j j j j t  |  j |  j j j j t   d S(   s6   Checking setting Bool attributes (scalar, Python case)s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R6   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test00a_setBoolAttributes  s     			c         C@ s  t  j t  |  j j _ t  j t  |  j j _ t  j t  |  j j _ t	 j
 r t d |  j j j  t d |  j j j  t d |  j j j  n  |  j r t	 j
 r t d  n  |  j d d  |  j j |  _ |  j j j |  _ n  |  j t |  j j j j t  j   |  j t |  j j j j t  j   |  j t |  j j j j t  j   |  j |  j j j j t  |  j |  j j j j t  |  j |  j j j j t  d S(   s5   Checking setting Bool attributes (scalar, NumPy case)s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   R   t   bool_R   R'   R=   R_   R   R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R   t
   isinstanceR6   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test00b_setBoolAttributes  s&    			%%%c         C@ sA  t  j t  |  j j _ t  j t  |  j j _ t  j t  |  j j _ t j	 r t
 d |  j j j  t
 d |  j j j  t
 d |  j j j  n  |  j r t j	 r t
 d  n  |  j d d  |  j j |  _ |  j j j |  _ n  |  j |  j j j j t  |  j |  j j j j t  |  j |  j j j j t  d S(   s4   Checking setting Bool attributes (NumPy, 0-dim case)s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   R   R'   R   R=   R_   R   R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R6   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test00c_setBoolAttributes  s     			c         C@ s  t  j t g  |  j j _ t  j t g g  |  j j _ t  j t t g t t g g  |  j j _ t j	 r t
 d |  j j j  t
 d |  j j j  t
 d |  j j j  n  |  j rt j	 r t
 d  n  |  j d d  |  j j |  _ |  j j j |  _ n  t |  j j j j t  j t g   t |  j j j j t  j t g g   t |  j j j j t  j t t g t t g g   d S(   s7   Checking setting Bool attributes (NumPy, multidim case)s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   R   R'   R   R=   R_   R   R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test00d_setBoolAttributes  s"    *			%(c         C@ s  d |  j  j _ d |  j  j _ d |  j  j _ t j r{ t d |  j  j j  t d |  j  j j  t d |  j  j j  n  |  j r t j r t d  n  |  j	 d d	  |  j
 j |  _ |  j
 j j |  _  n  |  j t |  j j j j t j   |  j t |  j j j j t j   |  j t |  j j j j t j   |  j |  j j j j d  |  j |  j j j j d  |  j |  j j j j d  d
 S(   s5   Checking setting Int attributes (scalar, Python case)i   i   i   s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   R'   R=   R_   R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R   R   R   t   int_R6   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test01a_setIntAttributes%  s&    			%%%c         C@ s   d d d d d d d g } x3 | D]+ } t  |  j j | t j d d	 |  q" Wt j r x0 | D]% } t d
 | t |  j j |   qa Wn  |  j r t j r t d  n  |  j	 d d  |  j
 j |  _ |  j
 j j |  _ n  x9 | D]1 } t t |  j j |  t j d d	 |  q Wd S(   s4   Checking setting Int attributes (scalar, NumPy case)t   int8t   int16t   int32t   int64t   uint8t   uint16t   uint32i   t   dtypes   type, value-->s   (closing file version)R/   s   r+N(   RH   R'   R=   R   R   R3   R4   RI   R2   R5   R"   R#   R   R   (   R*   t
   checktypesR   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test01b_setIntAttributes@  s"    )				c         C@ s  d d d d d d d g } x9 | D]1 } t  |  j j | t j d d	 g d
 |  q" W|  j r t j rv t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  xj | D]b } t j r t d | t |  j j |   n  t t |  j j |  t j d d	 g d
 |  q Wd S(   s;   Checking setting Int attributes (unidimensional NumPy case)R   R   R   R   R   R   R   i   i   R   s   (closing file version)R/   s   r+s   type, value-->N(   RH   R'   R=   R   R2   R   R3   R4   R5   R"   R#   R   RI   R   (   R*   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test01c_setIntAttributes[  s     /				c         C@ sM  d d d d d d d g } xR | D]J } t  j d d	 d
 d g d | d d d	  } t |  j j | |  q" W|  j r t j r t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  x | D]{ } t  j d d	 d
 d g d | d d d	  } t j r)t d | t |  j j |   n  t t |  j j |  |  q Wd S(   s@   Checking setting Int attributes (unidimensional, non-contiguous)R   R   R   R   R   R   R   i   i   i   i   R   Ns   (closing file version)R/   s   r+s   type, value-->(   R   R'   RH   R=   R2   R   R3   R4   R5   R"   R#   R   RI   R   (   R*   R   R   t   arr(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test01d_setIntAttributest  s"    .		.		c         C@ s3  d d d d d d d g } xE | D]= } t  |  j j | t j d d	 g d	 d
 g g d |  q" W|  j r t j r t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  xv | D]n } t j r t d | t |  j j |   n  t t |  j j |  t j d d	 g d	 d
 g g d |  q Wd S(   s:   Checking setting Int attributes (bidimensional NumPy case)R   R   R   R   R   R   R   i   i   i   R   s   (closing file version)R/   s   r+s   type, value-->N(   RH   R'   R=   R   R2   R   R3   R4   R5   R"   R#   R   RI   R   (   R*   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test01e_setIntAttributes  s"    ,				c         C@ s  d |  j  j _ d |  j  j _ d |  j  j _ t j r{ t d |  j  j j  t d |  j  j j  t d |  j  j j  n  |  j r t j r t d  n  |  j	 d d	  |  j
 j |  _ |  j
 j j |  _  n  |  j t |  j j j j t j   |  j t |  j j j j t j   |  j t |  j j j j t j   |  j |  j j j j d  |  j |  j j j j d  |  j |  j j j j d  d
 S(   s+   Checking setting Float (double) attributes.g      ?g       @g      @s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   R'   R=   R_   R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R   R   R   t   float_(   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test02a_setFloatAttributes  s&    			%%%c         C@ s  d d g } x3 | D]+ } t  |  j j | t j d d |  q Wt j r~ x0 | D]% } t d | t |  j j |   qR Wn  |  j r t j r t d  n  |  j	 d d  |  j
 j |  _ |  j
 j j |  _ n  x* | D]" } t t |  j j |  d  q Wd	 S(
   s6   Checking setting Float attributes (scalar, NumPy case)t   float32t   float64g?R   s   type, value-->s   (closing file version)R/   s   r+N(   RH   R'   R=   R   R   R3   R4   RI   R2   R5   R"   R#   R   R   (   R*   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test02b_setFloatAttributes  s     				c         C@ s  d d g } x9 | D]1 } t  |  j j | t j d d g d |  q Wt j r x0 | D]% } t d | t |  j j |   qX Wn  |  j r t j r t d  n  |  j	 d d	  |  j
 j |  _ |  j
 j j |  _ n  x? | D]7 } t t |  j j |  t j d d g d |  q Wd
 S(   s=   Checking setting Float attributes (unidimensional NumPy case)R   R   g?g @R   s   type, value-->s   (closing file version)R/   s   r+N(   RH   R'   R=   R   R   R3   R4   RI   R2   R5   R"   R#   R   R   (   R*   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test02c_setFloatAttributes  s"     				c         C@ sO  d d g } xR | D]J } t  j d d d d g d | d d	 d
  } t |  j j | |  q Wt j r x0 | D]% } t d | t |  j j |   qq Wn  |  j r t j r t d  n  |  j	 d d  |  j
 j |  _ |  j
 j j |  _ n  xX | D]P } t  j d d d d g d | d d	 d
  } t t |  j j |  |  q Wd	 S(   sJ   Checking setting Float attributes (unidimensional,
        non-contiguous)R   R   g?g @g@gffffff@R   i   Ni   s   type, value-->s   (closing file version)R/   s   r+(   R   R'   RH   R=   R   R3   R4   RI   R2   R5   R"   R#   R   R   (   R*   R   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test02d_setFloatAttributes  s"    .				.c         C@ s5  d d g } xE | D]= } t  |  j j | t j d d g d d g g d |  q Wt j r x0 | D]% } t d | t |  j j |   qd Wn  |  j r t j r t d  n  |  j	 d	 d
  |  j
 j |  _ |  j
 j j |  _ n  xK | D]C } t t |  j j |  t j d d g d d g g d |  q Wd S(   s:   Checking setting Int attributes (bidimensional NumPy case)R   R   g?g @g@R   s   type, value-->s   (closing file version)R/   s   r+N(   RH   R'   R=   R   R   R3   R4   RI   R2   R5   R"   R#   R   R   (   R*   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test02e_setFloatAttributes  s$    ,				c         C@ sN  d d g |  j  j _ d |  j  j _ i d d 6d d 6|  j  j _ t j r t d |  j  j j  t d |  j  j j  t d	 |  j  j j  n  |  j r t j r t d
  n  |  j	 d d  |  j
 j |  _ |  j
 j j |  _  n  |  j |  j j j j d d g  |  j |  j j j j d  |  j |  j j j j i d d 6d d 6 d S(   s#   Checking setting Object attributes.g      ?i   i   g@@t   ddft   dsds   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   i   i   (   i   i   (   R'   R=   R_   R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R6   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test03_setObjectAttributes/  s     			"c         C@ s  d |  j  j _ d |  j  j _ d |  j  j _ t j r{ t d |  j  j j  t d |  j  j j  t d |  j  j j  n  |  j r t j r t d  n  |  j	 d d	  |  j
 j |  _ |  j
 j j |  _  n  |  j t |  j j j j t j   |  j t |  j j j j t j   |  j t |  j j j j t j   |  j |  j j j j d  |  j |  j j j j d  |  j |  j j j j d  d
 S(   s0   Checking setting string attributes (scalar case)t   foot   bart   bazs   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   R'   R=   R_   R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R   R   R   t   str_R6   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test04a_setStringAttributesH  s&    			%%%c         C@ s   t  j d g  |  j j _ t j r= t d |  j j j  n  |  j r t j r\ t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  t |  j
 j j j t  j d g   d S(   s?   Checking setting string attributes (unidimensional 1-elem case)R   s   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test04b_setStringAttributesc  s    			c         C@ s   t  j d g  |  j j _ t j r= t d |  j j j  n  |  j r t j r\ t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ t j r t d |  j j j  q n  t |  j
 j j j t  j d g   d S(   sM   Checking setting string attributes (empty unidimensional
        1-elem case)R@   s   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test04c_setStringAttributesu  s    				c         C@ s   t  j d d g  |  j j _ t j r@ t d |  j j j  n  |  j r t j r_ t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  t |  j
 j j j t  j d d g   d S(   s?   Checking setting string attributes (unidimensional 2-elem case)R   t   bar3s   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test04d_setStringAttributes  s    			c         C@ s   t  j d d g  |  j j _ t j r@ t d |  j j j  n  |  j r t j r_ t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  t |  j
 j j j t  j d d g   d S(   sM   Checking setting string attributes (empty unidimensional
        2-elem case)R@   s   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test04e_setStringAttributes  s    			c         C@ s   t  j d d g d d g g  |  j j _ t j rL t d |  j j j  n  |  j r t j rk t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  t |  j
 j j j t  j d d g d d g g   d	 S(
   s>   Checking setting string attributes (bidimensional 4-elem case)R   t   foo2t   foo3t   foo4s   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test04f_setStringAttributes  s    			c         C@ s  d |  j  j _ d |  j  j _ d |  j  j _ t j r{ t d |  j  j j  t d |  j  j j  t d	 |  j  j j  n  |  j r t j r t d
  n  |  j	 d d  |  j
 j |  _ |  j
 j j |  _  n  |  j t |  j j j j t j   |  j t |  j j j j t j   |  j t |  j j j j t j   |  j |  j j j j d  |  j |  j j j j d  |  j |  j j j j d  d S(   s-   Checking setting Complex (python) attributes.g      ?y               @g       @y              @g      @y              @s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+Ny      ?       @y       @      @y      @      @y      ?       @y       @      @y      @      @(   R'   R=   R_   R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R   R   R   t   complex_R6   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test05a_setComplexAttributes  s&    			%%%c         C@ s  d d g } x3 | D]+ } t  |  j j | t j d d |  q Wt j r~ x0 | D]% } t d | t |  j j |   qR Wn  |  j r t j r t d  n  |  j	 d d	  |  j
 j |  _ |  j
 j j |  _ n  x* | D]" } t t |  j j |  d  q Wd
 S(   s8   Checking setting Complex attributes (scalar, NumPy case)t	   complex64t
   complex128g?y               @R   s   type, value-->s   (closing file version)R/   s   r+Ny?       @y?       @(   RH   R'   R=   R   R   R3   R4   RI   R2   R5   R"   R#   R   R   (   R*   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test05b_setComplexAttributes  s     				c         C@ s  d d g } x9 | D]1 } t  |  j j | t j d d g d |  q Wt j r x0 | D]% } t d | t |  j j |   qX Wn  |  j r t j r t d  n  |  j	 d d	  |  j
 j |  _ |  j
 j j |  _ n  x? | D]7 } t t |  j j |  t j d d g d |  q Wd
 S(   s?   Checking setting Complex attributes (unidimensional NumPy case)R   R   g?g @R   s   type, value-->s   (closing file version)R/   s   r+N(   RH   R'   R=   R   R   R3   R4   RI   R2   R5   R"   R#   R   R   (   R*   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test05c_setComplexAttributes  s"     				c         C@ s5  d d g } xE | D]= } t  |  j j | t j d d g d d g g d |  q Wt j r x0 | D]% } t d | t |  j j |   qd Wn  |  j r t j r t d  n  |  j	 d	 d
  |  j
 j |  _ |  j
 j j |  _ n  xK | D]C } t t |  j j |  t j d d g d d g g d |  q Wd S(   s:   Checking setting Int attributes (bidimensional NumPy case)R   R   g?g @g@R   s   type, value-->s   (closing file version)R/   s   r+N(   RH   R'   R=   R   R   R3   R4   RI   R2   R5   R"   R#   R   R   (   R*   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test05d_setComplexAttributes  s$    ,	 		c         C@ s  d |  j  j _ d |  j  j _ d |  j  j _ t j r t j d k rd t	 d t
 |  j  j j   n  t	 d |  j  j j  t	 d |  j  j j  n  |  j r t j r t	 d  n  |  j d	 d
  |  j j |  _ |  j j j |  _  n  |  j t |  j  j j t j   |  j t |  j  j j t j   |  j t |  j  j j t j   |  j |  j  j j d  |  j |  j  j j d  |  j |  j  j j d  d S(   s1   Checking setting unicode attributes (scalar case)u	   paraŀlelu    u   bazt   win32s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   R'   R=   R_   R`   Ra   R   R3   Rb   t   platformR4   t   reprR2   R5   R"   R#   R   R   R   R   t   unicode_R6   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test06a_setUnicodeAttributes2  s(    			"""c         C@ s   t  j d g  |  j j _ t j r= t d |  j j j  n  |  j r t j r\ t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  t |  j j j t  j d g   d S(   s@   Checking setting unicode attributes (unidimensional 1-elem case)u	   paraŀlels   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test06b_setUnicodeAttributesQ  s    			c         C@ s   t  j d g d d |  j j _ t j rC t d |  j j j  n  |  j r t j rb t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ t j r t d t |  j j j   q n  t |  j j j t  j d g d d  d S(	   sN   Checking setting unicode attributes (empty unidimensional
        1-elem case)u    R   t   U1s   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test06c_setUnicodeAttributesd  s    !				"c         C@ s   t  j d d g  |  j j _ t j r@ t d |  j j j  n  |  j r t j r_ t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  t |  j j j t  j d d g   d S(   s@   Checking setting unicode attributes (unidimensional 2-elem case)u	   paraŀlelu   bar3s   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test06d_setUnicodeAttributes}  s    			c         C@ s   t  j d d g d d |  j j _ t j rF t d |  j j j  n  |  j r t j re t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  t |  j j j t  j d d g d d  d S(	   sN   Checking setting unicode attributes (empty unidimensional
        2-elem case)R@   R   R   s   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test06e_setUnicodeAttributes  s    $			c         C@ s   t  j d d g d d g g  |  j j _ t j rL t d |  j j j  n  |  j r t j rk t d  n  |  j d d  |  j	 j
 |  _
 |  j	 j
 j |  _ n  t |  j j j t  j d d g d d g g   d	 S(
   s?   Checking setting unicode attributes (bidimensional 4-elem case)u	   paraŀlelR   R   u
   paraŀlel4s   pq -->s   (closing file version)R/   s   r+N(   R   R'   R=   R_   R   R3   R4   R2   R5   R"   R#   R   R   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test06f_setUnicodeAttributes  s    			c         C@ s  t  j d d |  j } t  j d |  |  j j _ t  j d |  |  j j _ t  j d g |  |  j j _	 t
 j r t d |  j j j  t d |  j j j  t d |  j j j	  n  |  j rt
 j r t d	  n  |  j d
 d  |  j j |  _ |  j j j |  _ n  |  j t |  j j j t  j   |  j t |  j j j t  j   |  j t |  j j j	 t  j   t |  j j j t  j d |   t |  j j j t  j d |   t |  j j j	 t  j d g |   d S(   s-   Checking setting RecArray (NumPy) attributes.s   i4,f8t   aligni   i   g       @s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   i   i   (   i   g       @(   i   i   (   i   g       @(   R   R   t   alignedt   zerosR'   R=   R_   t   onesR`   Ra   R   R3   R4   R2   R5   R"   R#   R   R   R   t   ndarrayR   (   R*   t   dt(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test07a_setRecArrayAttributes  s(    			"""""c         C@ s  t  j d d d g f g  } t  j d |  |  j j _ t  j d |  |  j j _ t  j d g |  |  j j _ t	 j
 r t d |  j j j  t d	 |  j j j  t d
 |  j j j  n  |  j rt	 j
 r t d  n  |  j d d  |  j j |  _ |  j j j |  _ n  |  j t |  j j j t  j   |  j t |  j j j t  j   |  j t |  j j j t  j   t |  j j j t  j d |   t |  j j j t  j d |   t |  j j j t  j d g |   d S(   s4   Checking setting nested RecArray (NumPy) attributes.t   f1t   i2t   f2t   f8i   i   g       @s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   R  R  (   R  R  (   i   i   (   i   g       @(   (   i   g       @(   i   i   (   i   i   (   (   i   i   (   R   R   R   R'   R=   R_   R  R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R   R   R  R   (   R*   R  (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test07b_setRecArrayAttributes  s(    			"""""c         C@ s  t  j d d d d f d g f g d t } t  j d |  |  j j _ t  j d |  |  j j _ t  j d d g d	 f f g |  |  j j _	 t
 j r t d
 |  j j j  t d |  j j j  t d |  j j j	  n  |  j r1t
 j r t d  n  |  j d d  |  j j |  _ |  j j j |  _ n  |  j t |  j j j t  j   |  j t |  j j j t  j   |  j t |  j j j	 t  j   t |  j j j t  j d |   t |  j j j t  j d |   t |  j j j	 t  j d d g d f f g |   d S(   s=   Checking setting multidim nested RecArray (NumPy) attributes.R  R  i   R  R  R   i   i   g       @s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+N(   i   (   R  R  (   i   i   (   i   i   (   R   R   R   R   R'   R=   R_   R  R`   Ra   R   R3   R4   R2   R5   R"   R#   R   R   R   R  R   (   R*   R  (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test07c_setRecArrayAttributes  s*    --			"""""c         C@ s  t  j d d |  j } t  j d |  |  j j _ t  j d |  |  j j _ t  j d g |  |  j j _	 t
 j r t d |  j j j  t d |  j j j  t d |  j j j	  n  |  j rt
 j r t d	  n  |  j d
 d d t  |  j j |  _ |  j j j |  _ n  |  j t |  j j j t  j   |  j t |  j j j t  j   |  j t |  j j j	 t  j   t |  j j j t  j d |   t |  j j j t  j d |   t |  j j j	 t  j d g |   d S(   si   Checking setting aligned RecArray (NumPy) attributes with `allow_aligned` param set to False when reopen.s   i4,f8R   i   i   g       @s   pq -->s   qr -->s   rs -->s   (closing file version)R/   s   r+t   allow_alignN(   i   i   (   i   g       @(   i   i   (   i   g       @(   R   R   R   R   R'   R=   R_   R  R`   Ra   R   R3   R4   R2   R5   R   R"   R#   R   R   R   R  R   (   R*   R  (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt!   test08_setRecArrayNotAllowPadding  s(    			"""""(&   R   R   R!   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R	  R
  R  (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR     sH   																																			 t   NotCloseTypesTestCasec           B@ s   e  Z e Z e Z e Z RS(    (   R   R   R   R   R   R2   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR  2  s   t   NoCloseAlignedTypesTestCasec           B@ s   e  Z e Z e Z e Z RS(    (   R   R   R   R   R   R   R2   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR  8  s   t"   CloseNotAlignedPaddedTypesTestCasec           B@ s   e  Z e Z e Z e Z RS(    (   R   R   R   R   R   R   R2   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR  >  s   t   CloseTypesTestCasec           B@ s   e  Z e Z e Z e Z RS(    (   R   R   R   R   R   R   R2   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR  D  s   t   CloseAlignedTypesTestCasec           B@ s   e  Z e Z e Z e Z RS(    (   R   R   R   R   R   R   R2   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR  J  s   t   CloseAlignedPaddedTypesTestCasec           B@ s   e  Z e Z e Z e Z RS(    (   R   R   R   R   R   R2   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR  O  s   t   NoSysAttrsTestCasec           B@ s)   e  Z e d  e  Z d   Z d   Z RS(   t   pytables_sys_attrsc         C@ s   t  t |   j   |  j j |  _ |  j j |  j d t d  |  _ |  j j |  j d d g d  |  _	 |  j j
 |  j d d  |  _ d  S(   NR   s   Table titleR   i   s   Array titleR   s   Group title(   R    R  R!   R"   R#   R$   R   R%   R&   R'   R(   R)   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR!   X  s    c         C@ s  d |  j  j _ d |  j  j _ d |  j  j _ t j rR t d |  j  j j    n  d |  j	 j
 _ d |  j	 j
 _ d |  j	 j
 _ t j r t d |  j	 j
 j    n  d |  j j
 _ d |  j j
 _ d |  j j
 _ t j r t d |  j j
 j    n  |  j r7t j rt d  n  |  j d d  |  j j |  _ n  |  j j } |  j | j j d  d	 d
 d g  |  j | j j d  g   |  j | j j d  d	 d
 d g  |  j j } |  j | j
 j   d d d g  |  j | j
 j d  g   |  j | j
 j d  d d d g  |  j j } |  j | j
 j   d d d g  |  j | j
 j d  g   |  j | j
 j d  d d d g  d S(   s6   Checking listing attributes (no system attrs version).R[   R\   R]   s   Attribute list:s   (closing file version)R/   s   r+R^   R_   R`   Ra   Rb   Rf   R-   Rg   Rh   Rt   Ru   Rv   N(   R)   R<   R_   R`   Ra   R   R3   R4   Rx   R%   R=   R-   Rh   Rg   R'   Rv   Ru   Rt   R2   R5   R"   R#   R   R6   R   R   (   R*   R   R   R   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test00_listAttributesf  s@    					%%"%"(   R   R   R   R   R   R!   R  (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR  U  s   	t   NoSysAttrsNotClosec           B@ s   e  Z e Z RS(    (   R   R   R   R2   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR    s   t   NoSysAttrsClosec           B@ s   e  Z e Z RS(    (   R   R   R   R2   (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR    s   t   CompatibilityTestCasec           B@ s>   e  Z e d   Z e j e e j  d k  d  d    Z	 RS(   s   issue_368.h5s   1.9.0s   requires numpy >= 1.9c         C@ s#   |  j  |  j j d d  d  d  S(   Nt   /t   py2_pickled_unicodeu   abc(   R6   R"   R7   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test_pickled_unicode_attrs  s    (
   R   R   R   t   h5fnameR   R   R   R   t   __version__R  (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR    s   t   PicklePy2UnpicklePy3TestCasec           B@ sO   e  Z e d   Z e j e j d d k o; e j d d k  d  d    Z RS(   s   issue_560.h5i    i   i   i   s   bug not fixed on python3<=3.3.c         C@ s_   |  j  |  j j d d  t j  |  j j d d  } |  j  | t  |  j | d d  d  S(   NR  t   py2_pickled_datetimet   py2_pickled_dictt   su   just a string(   t   assertIsInstanceR"   R7   t   datetimeR   R6   (   R*   t   d(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test_pickled_datetime_object  s    
(	   R   R   R   R  R   R   Rb   R   R%  (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR    s   )t   SegFaultPythonTestCasec           B@ s   e  Z d    Z RS(   c         C@ s   d |  j  j j _ |  j |  j  j j j d  d |  j  j j _ |  j |  j  j j j d  |  j   |  j |  j  j j j d  |  j |  j  j j j d  t j r t	 d  n  d S(   s;   Checking workaround for Python unpickle problem (see #253).t   0s   0.s3   Great! '0' and '0.' values can be safely retrieved.N(
   R"   R#   R<   t   trouble1R6   t   trouble2R5   R   R3   R4   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test00_segfault  s    
	(   R   R   R*  (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR&    s   t   EmbeddedNullsTestCasec           B@ s   e  Z d    Z d   Z RS(   c         C@ s^   d } | |  j  j j _ |  j |  j  j j j |  |  j   |  j |  j  j j j |  d  S(   Nu   string with a null byte   in it(   R"   R#   R<   R>   R6   R5   (   R*   t   value(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test_unicode  s
    
c         C@ s^   d } | |  j  j j _ |  j |  j  j j j |  |  j   |  j |  j  j j j |  d  S(   Ns   string with a null byte   in it(   R"   R#   R<   R>   R6   R5   (   R*   R,  (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt
   test_bytes  s
    
(   R   R   R-  R.  (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR+    s   	
t   VlenStrAttrTestCasec           B@ s5   e  Z d    Z d   Z d   Z d   Z d   Z RS(   c         C@ s;   t  t |   j   t d  |  _ t j |  j  |  _ d  S(   Ns   vlstr_attr.h5(   R    R/  R!   R   R  RS   t	   open_fileR"   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR!     s    c         C@ s$   |  j  j   t t |   j   d  S(   N(   R"   R2   R    R/  t   tearDown(   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR1    s    c         C@ s2   d } |  j  |  j j d |  | j d   d S(   s5   Checking file with variable length string attributes.t   vlen_str_scalarR  t   asciiN(   R6   R"   R7   t   encode(   R*   t   attr(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test01_vlen_str_scalar  s    c         C@ sx   d } |  j  j d |  } |  j | j d  xC t |  D]5 \ } } d | | f } |  j | | j d   q; Wd S(   s:   Checking file with variable length string attributes (1d).t   vlen_str_arrayR  i   s   %s_%dR3  N(   R"   R7   R6   t   ndimt	   enumerateR4  (   R*   R5  t   vt   idxt   itemR,  (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test02_vlen_str_array  s    c         C@ s   d } |  j  j d |  } |  j | j d  xc t |  D]U \ } } xF t |  D]8 \ } } d | | | f } |  j | | j d   qT Wq; Wd S(   s:   Checking file with variable length string attributes (2d).t   vlen_str_matrixR  i   s   %s_%d%dR3  N(   R"   R7   R6   R8  R9  R4  (   R*   R5  t   mt   rowt   rowdatat   colR<  R,  (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test03_vlen_str_matrix  s    (   R   R   R!   R1  R6  R=  RC  (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyR/    s
   				
t   UnsupportedAttrTypeTestCasec           B@ s   e  Z e d   Z d   Z RS(   s   attr-u16.h5c         C@ s   |  j  t t |  j  d S(   s$   Checking file with unsupported type.N(   t   assertWarnsR   R   R"   (   R*   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test00_unsupportedType!  s    (   R   R   R   R  RF  (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyRD    s   t   SpecificAttrsTestCasec           B@ sb   e  Z d    Z d   Z e j e j d k d  d    Z e j e j d k d  d    Z	 RS(   c         C@ sW   |  j  j d d t   d	  } t j r= t d | j j  n  |  j | j j d  d S(
   s'   Testing EArray specific attrs (create).R  t   eai   i    i   s	   EXTDIM-->i   N(   i   i    i   (	   R"   t   create_earrayR   R   R3   R4   R=   t   EXTDIMR6   (   R*   RH  (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test00_earray*  s    	c         C@ ss   |  j  j d d t   d	  } |  j d  |  j  j j } t j rY t d | j	 j
  n  |  j | j	 j
 d  d S(
   s%   Testing EArray specific attrs (open).R  RH  i    i   i   t   rs	   EXTDIM-->N(   i    i   i   (   R"   RI  R   R5   R#   RH  R   R3   R4   R=   RJ  R6   (   R*   RH  (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test01_earray2  s    	i   s   requires Python 2c         C@ s2   d } | |  j  j _ |  j |  j  j j |  d  S(   Nu   Elevation −200m(   R"   R#   t   _v_titleR6   (   R*   t   title(    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test02_unicode_title<  s    c         C@ s<   d } | |  j  j _ |  j   |  j |  j  j j |  d  S(   Nu   Elevation −200m(   R"   R#   RN  R5   R6   (   R*   RO  (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   test03_unicode_title_reopenC  s    
(   i   (   i   (
   R   R   RK  RM  R   R   Rb   R   RP  RQ  (    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyRG  (  s   		
$c          C@ s  t  j   }  d } xt |  D]} |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t	   |  j t  j t
   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   |  j t  j t   q W|  S(   Ni   (   R   t	   TestSuiteR   t   addTestt	   makeSuiteR   R   R   R   R   R   R  R  R  R  R  R  R  R  R  R  R&  R+  R/  RD  RG  (   t   theSuitet   niterRt   (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   suiteL  s2    t   __main__t   defaultTestRW  (C   t   __doc__t
   __future__R    R   Rb   R#  RP   t   distutils.versionR   R   t   numpy.testingR   R   RS   R   R   R   R   R	   R
   R   t   tables.exceptionsR   t   tables.parametersR   t   tables.testsR   t   tables.tests.commonR   R   R   t   TestCaset	   six.movesR   R   t   TempFileMixinR   R   R   R   R   R   R   R   R  R  R  R  R  R  R  R  R  t   TestFileMixinR  R  R&  R+  R/  RD  RG  RW  R   t
   parse_argvt   argvt   print_versionst   main(    (    (    s;   lib/python2.7/site-packages/tables/tests/test_attributes.pyt   <module>   sf   4  o   ?'
$	
