ó
jˆú\c           @@ sk  d  d l  m Z d  d l  m Z d  d l Z d  d l Z d  d l 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 d  d	 l m Z d  d
 l m Z d e j e f d „  ƒ  YZ d e f d „  ƒ  YZ d e j e f d „  ƒ  YZ d e j e f d „  ƒ  YZ d Z d „  Z d e j e f d „  ƒ  YZ d e j e f d „  ƒ  YZ d e j e f d „  ƒ  YZ d e j e f d „  ƒ  YZ  d e j e f d „  ƒ  YZ! d e j e f d  „  ƒ  YZ" d! e j e f d" „  ƒ  YZ# d# e j e f d$ „  ƒ  YZ$ d% „  Z% e& d& k rgd  d l' Z' e j( e' j) ƒ e j* ƒ  e j+ d' d( ƒ n  d S()   i    (   t   print_function(   t   absolute_importN(   t   IsDescriptiont	   StringColt   BoolColt   IntColt   FloatCol(   t   NotLoggedMixin(   t	   join_path(   t   common(   t   unittest(   t   PyTablesTestCase(   t   ranget   BasicTestCasec           B@ sã   e  Z d  Z 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 RS(   s$   Test for basic Undo/Redo operations.c         C@ s   |  j  r |  j d ƒ n  d  S(   Ns   r+(   t   _reopen_flagt   _reopen(   t   self(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt
   _do_reopen   s    	c         C@ sÎ   t  t |  ƒ j ƒ  |  j } | j } | j | d d d g d d ƒ| j | d d g d ƒ | j | d d	 ƒ } | j | d
 d g d ƒ | j | d d g d ƒ | j | d d ƒ | j | d d ƒ d  S(   Nt   arrayi   i   t   titles   Title examplet   anarrays   Array titlet   agroups   Group titlet   anarray1s   Array title 1t   anarray2s   Array title 2t   agroup2s   Group title 2t   agroup3s   Group title 3(   t   superR   t   setUpt   h5filet   roott   create_arrayt   create_group(   R   R   R   t   group(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR      s    		c         C@ sf  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j ƒ  |  j	 d
 |  j k ƒ |  j
 |  j j d ƒ |  j
 |  j j d ƒ |  j ƒ  |  j j ƒ  t  j rß t d |  j ƒ n  |  j	 d
 |  j k ƒ |  j
 |  j j j j ƒ  d d g ƒ |  j
 |  j j j j d	 ƒ |  j
 |  j j d ƒ |  j
 |  j j d ƒ d S(   s   Checking simple do/undo.s   
s   -=i   s   Running %s.test00_simple...t   /t
   otherarrayi   i   s   Another arrays   /otherarrayi    s   Object tree after redo:i   N(   R	   t   verboset   printt	   __class__t   __name__R   t   enable_undoR   t   undot
   assertTruet   assertEqualt
   _curactiont   _curmarkR   t   redoR   R"   t   readR   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test00_simple5   s$    	
	%c         C@ sÖ  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j d d
 d d g d ƒ |  j ƒ  |  j j	 ƒ  |  j
 d |  j k ƒ |  j
 d |  j k ƒ |  j |  j j d ƒ |  j |  j j d ƒ |  j j ƒ  |  j
 d |  j k ƒ |  j
 d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j d	 ƒ |  j |  j j j j d ƒ |  j |  j j d ƒ |  j |  j j d ƒ d S(   s/   Checking do/undo (twice operations intertwined)s   
s   -=i   s   Running %s.test01_twice...R!   R"   i   i   s   Another arrayt   otherarray2i   s   Another array 2s   /otherarrays   /otherarray2i    i   N(   R	   R#   R$   R%   R&   R   R'   R   R   R(   R)   R*   R+   R,   R-   R   R"   R.   R0   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test01_twiceW   s*    	
%%c         C@ sã  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j ƒ  |  j j	 ƒ  |  j j d d
 d d g d ƒ |  j
 |  j j d ƒ |  j
 |  j j d ƒ |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j
 |  j j d ƒ |  j
 |  j j d ƒ |  j j ƒ  |  j
 |  j j d ƒ |  j
 |  j j d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j ƒ  |  j
 |  j j d ƒ |  j
 |  j j d ƒ |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j
 |  j j j j ƒ  d d g ƒ |  j
 |  j j j j ƒ  d d g ƒ |  j
 |  j j j j d	 ƒ |  j
 |  j j j j d ƒ |  j
 |  j j d ƒ |  j
 |  j j d ƒ d S(   s!   Checking twice ops and two marks.s   
s   -=i   s   Running %s.test02_twice2...R!   R"   i   i   s   Another arrayR0   i   s   Another array 2i   s   /otherarrays   /otherarray2i   i    N(   R	   R#   R$   R%   R&   R   R'   R   R   t   markR*   R+   R,   R(   R)   R-   R   R"   R.   R0   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test02_twice2z   sF    	

%%c         C@ s  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j d d
 d d g d ƒ |  j j ƒ  |  j j d d d d g d ƒ |  j j d d d d g d ƒ |  j	 ƒ  |  j j ƒ  |  j j d d d d g d ƒ |  j j d d d d g d ƒ |  j j
 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j
 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j
 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j	 ƒ  |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j d	 ƒ |  j |  j j j j d ƒ |  j |  j j j j d ƒ |  j |  j j j j d ƒ |  j |  j j j j d ƒ |  j |  j j j j d ƒ d S(    s&   Checking with six ops and three marks.s   
s   -=i   s!   Running %s.test03_6times3marks...R!   t   otherarray1i   i   s   Another array 1R0   i   s   Another array 2t   otherarray3i   s   Another array 3t   otherarray4i   s   Another array 4t   otherarray5i   s   Another array 5t   otherarray6i	   s   Another array 6s   /otherarray1s   /otherarray2s   /otherarray3s   /otherarray4s   /otherarray5s   /otherarray6N(   R	   R#   R$   R%   R&   R   R'   R   R2   R   R(   R)   R-   R*   R   R4   R.   R0   R5   R6   R7   R8   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test03_6times3marks¯   sŠ    	

%%%%%%c         C@ sö  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j d d
 d d g d ƒ |  j j ƒ  |  j	 ƒ  |  j j d d d d g d ƒ |  j j d d d d g d ƒ |  j j
 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ t  j rXt d |  j j ƒ  ƒ n  |  j j ƒ  |  j	 ƒ  |  j j d d d d g d ƒ |  j j d d d d g d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j
 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j	 ƒ  |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j d	 ƒ |  j |  j j j j d ƒ |  j |  j j j j d ƒ |  j |  j j j j d ƒ d  S(!   sN   Checking with six operations, three marks and do/undo in random
        order.s   
s   -=i   s#   Running %s.test04_6times3marksro...R!   R4   i   i   s   Another array 1R0   i   s   Another array 2R5   i   s   Another array 3R6   i   s   Another array 4s   /otherarray1s   /otherarray2s   /otherarray3s   /otherarray4s
   All nodes:R7   i   s   Another array 5R8   i	   s   Another array 6s   /otherarray5s   /otherarray6N(   R	   R#   R$   R%   R&   R   R'   R   R2   R   R(   R)   t
   walk_nodesR-   R*   R   R4   R.   R0   R7   R8   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test04_6times3marksro  st    	
	

%%%%c         C@ s‘  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j ƒ  |  j	 ƒ  |  j j d d
 d d g d ƒ |  j j
 ƒ  |  j	 ƒ  |  j j d d d d g d ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j d	 ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j d ƒ d S(   s/   Checking with a destructive action during undo.s   
s   -=i   s    Running %s.test05_destructive...R!   R4   i   i   s   Another array 1R0   i   s   Another array 2R5   i   s   Another array 3s   /otherarray1s   /otherarray2s   /otherarray3N(   R	   R#   R$   R%   R&   R   R'   R   R2   R   R(   R)   R*   R   R4   R.   R   R5   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test05_destructive[  s$    	

%%c         C@ sö  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j ƒ  |  j j	 ƒ  |  j j d d
 d d g d ƒ |  j j
 ƒ  |  j j d d d d g d ƒ |  j ƒ  |  j j	 ƒ  |  j j d d d d g d ƒ |  j d |  j k ƒ |  j j
 ƒ  |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j d	 ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j d ƒ |  j d |  j k ƒ d S(   s3   Checking with a destructive action during undo (II)s   
s   -=i   s!   Running %s.test05b_destructive...R!   R4   i   i   s   Another array 1R0   i   s   Another array 2R5   i   s   Another array 3R6   i   s   Another array 4s   /otherarray4s   /otherarray1s   /otherarray2s   /otherarray3N(   R	   R#   R$   R%   R&   R   R'   R   R   R2   R(   R)   R*   R   R4   R.   R   R5   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test05b_destructive}  s0    	

%%c         C@ s‹  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j ƒ  |  j	 ƒ  |  j j d d
 d d g d ƒ |  j j
 ƒ  |  j j d d d d g d ƒ |  j j ƒ  |  j	 ƒ  |  j j d d d d g d ƒ |  j d |  j k ƒ |  j j
 ƒ  |  j	 ƒ  |  j j
 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ d S(   s4   Checking with a destructive action during undo (III)s   
s   -=i   s!   Running %s.test05c_destructive...R!   R4   i   i   s   Another array 1R0   i   s   Another array 2R5   i   s   Another array 3R6   i   s   Another array 4s   /otherarray4s   /otherarray1s   /otherarray2s   /otherarray3N(   R	   R#   R$   R%   R&   R   R'   R   R2   R   R(   R)   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test05c_destructive©  s,    	


c         C@ sw  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j ƒ  |  j j	 ƒ  |  j j d d
 d d g d ƒ |  j j
 ƒ  |  j j d d d d g d ƒ |  j j	 ƒ  |  j j d d d d g d ƒ |  j d |  j k ƒ |  j ƒ  |  j j
 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ d S(   s3   Checking with a destructive action during undo (IV)s   
s   -=i   s!   Running %s.test05d_destructive...R!   R4   i   i   s   Another array 1R0   i   s   Another array 2R5   i   s   Another array 3R6   i   s   Another array 4s   /otherarray4i    s   /otherarray1s   /otherarray2s   /otherarray3N(   R	   R#   R$   R%   R&   R   R'   R   R   R2   R(   R)   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test05d_destructiveÓ  s(    	

c         C@ s  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j ƒ  |  j j d d
 d d g d ƒ |  j j	 ƒ  |  j
 ƒ  |  j j d d d d g d ƒ |  j j	 d ƒ |  j
 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ d S(   s2   Checking with a destructive action during undo (V)s   
s   -=i   s!   Running %s.test05e_destructive...R!   R4   i   i   s   Another array 1R0   i   s   Another array 2R5   i   s   Another array 3i    s   /otherarray1s   /otherarray2s   /otherarray3N(   R	   R#   R$   R%   R&   R   R'   R   R2   R(   R   R)   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test05e_destructiveû  s     	

c         C@ s  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d g ƒ |  j j ƒ  |  j	 ƒ  |  j
 d |  j k ƒ |  j j d d d g ƒ } |  j j ƒ  |  j
 d |  j k ƒ |  j	 ƒ  |  j j ƒ  |  j
 d |  j k ƒ |  j s|  j
 |  j j j | k ƒ n  d	 S(
   sA   Checking with a destructive creation of existing node during undos   
s   -=i   s!   Running %s.test05f_destructive...R!   t   newarrayi   s	   /newarrayN(   R	   R#   R$   R%   R&   R   R'   R   R(   R   R)   R-   R   R   RA   (   R   t   newarr(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test05f_destructive  s"    	

	c         C@ sÓ   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j ƒ  |  j j d d
 d d g d ƒ |  j	 ƒ  |  j j
 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ d S(   s   Checking do/undo (total unwind)s   
s   -=i   s    Running %s.test06_totalunwind...R!   R"   i   i   s   Another arrayR0   i   s   Another array 2i    s   /otherarrays   /otherarray2N(   R	   R#   R$   R%   R&   R   R'   R   R2   R   R(   R)   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test06_totalunwind3  s    	
c         C@ se  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j ƒ  |  j j d d
 d d g d ƒ |  j j	 d ƒ |  j
 ƒ  |  j j d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j d	 ƒ |  j |  j j j j d ƒ d S(   s   Checking do/undo (total rewind)s   
s   -=i   s    Running %s.test07_totalunwind...R!   R"   i   i   s   Another arrayR0   i   s   Another array 2i    iÿÿÿÿs   /otherarrays   /otherarray2N(   R	   R#   R$   R%   R&   R   R'   R   R2   R(   R   R-   R)   R*   R   R"   R.   R0   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test07_totalrewindH  s     	
%%c         C@ s6  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j d
 ƒ |  j j d d d d g d ƒ |  j j d ƒ |  j j d d d d g d ƒ |  j j d ƒ |  j j d d d d g d ƒ |  j j	 d
 ƒ |  j
 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j	 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j
 ƒ  |  j j d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ d S(   s   Checking mark names.s   
s   -=i   s   Running %s.test08_marknames...R!   R4   i   i   s   Another array 1t   firstR0   i   s   Another array 2t   secondR5   i   s   Another array 3t   thirdR6   i   s   Another array 4s   /otherarray1s   /otherarray2s   /otherarray3s   /otherarray4iÿÿÿÿN(   R	   R#   R$   R%   R&   R   R'   R   R2   R(   R   R)   R-   R*   R   R4   R.   R0   R5   R6   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test08_marknamesf  sJ    	

%%%c         C@ sª  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j ƒ  } |  j j d d d d g d	 ƒ |  j j	 ƒ  |  j
 ƒ  |  j j d d
 d d g d ƒ |  j j | ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j d ƒ |  j
 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j d	 ƒ |  j |  j j j j d ƒ d S(   s   Checking initial mark.s   
s   -=i   s    Running %s.test08_initialmark...R!   R"   i   i   s   Another arrayR0   i   s   Another array 2s   /otherarrays   /otherarray2iÿÿÿÿN(   R	   R#   R$   R%   R&   R   R'   t   get_current_markR   R2   R   R(   R)   R-   R*   R   R"   R.   R0   R   (   R   t   initmid(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test08_initialmark  s(    	

%%c         C@ sÌ  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j d
 ƒ |  j j d d d d g d ƒ |  j j d ƒ |  j	 ƒ  |  j j d d d d g d ƒ |  j j d ƒ |  j j d d d d g d ƒ |  j j
 d
 ƒ |  j t j ƒ  |  j j
 d ƒ Wd QX|  j j d ƒ |  j	 ƒ  |  j t j ƒ  |  j j d ƒ Wd QX|  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ d S(   s%   Checking mark names (wrong direction)s   
s   -=i   s   Running %s.test09_marknames...R!   R4   i   i   s   Another array 1RF   R0   i   s   Another array 2RG   R5   i   s   Another array 3RH   R6   i   s   Another array 4Ns   /otherarray1s   /otherarray2s   /otherarray3s   /otherarray4(   R	   R#   R$   R%   R&   R   R'   R   R2   R   R(   t   assertRaisest   tablest   UndoRedoErrorR-   R)   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test09_marknames¿  s.    	

c         C@ sV  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j ƒ  |  j j	 d
 ƒ |  j j d d d d g d ƒ |  j j	 d ƒ |  j j d d d d g d ƒ |  j ƒ  |  j j	 d ƒ |  j j d d d d g d ƒ |  j j
 d
 ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j
 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j ƒ  |  j j
 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j
 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ d S(   s   Checking mark names (goto)s   
s   -=i   s   Running %s.test10_goto...R!   R4   i   i   s   Another array 1RF   R0   i   s   Another array 2RG   R5   i   s   Another array 3RH   R6   i   s   Another array 4s   /otherarray1s   /otherarray2s   /otherarray3s   /otherarray4iÿÿÿÿN(   R	   R#   R$   R%   R&   R   R'   R   R   R2   t   gotoR)   R*   R   R4   R.   R0   R5   R6   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test10_gotoè  sN    	


%%%c         C@ sÈ  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j d
 ƒ |  j j d d d d g d ƒ |  j j d ƒ |  j	 ƒ  |  j j d d d d g d ƒ |  j j d ƒ |  j j d d d d g d ƒ |  j j
 d ƒ |  j	 ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j
 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j	 ƒ  |  j j
 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j
 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j	 ƒ  |  j j
 d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ d S(   s#   Checking mark sequential ids (goto)s   
s   -=i   s   Running %s.test10_gotoint...R!   R4   i   i   s   Another array 1RF   R0   i   s   Another array 2RG   R5   i   s   Another array 3RH   R6   i   s   Another array 4i   s   /otherarray1s   /otherarray2s   /otherarray3s   /otherarray4i    i   iÿÿÿÿN(   R	   R#   R$   R%   R&   R   R'   R   R2   R   RQ   R)   R*   R   R4   R.   R0   R5   R6   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test10_gotoint!  sZ    	



%%%c         C@ sz  t  j r1 t d d d ƒ t d |  j j ƒ n  |  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 ƒ |  j	 ƒ  |  j |  j j ƒ  | ƒ |  j j d ƒ |  j |  j j ƒ  d ƒ d S(   s   Creating contiguous markss   
s   -=i   s   Running %s.test11_contiguous...iÿÿÿÿi    N(   R	   R#   R$   R%   R&   R   R'   R2   t   assertNotEqualR   R(   R*   RJ   R-   RQ   (   R   t   m1t   m2(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test11_contiguousb  s*    	

c         C@ sÃ   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d g ƒ |  j j ƒ  } |  j	 | d
 k	 ƒ |  j ƒ  |  j j ƒ  |  j |  j j ƒ  d ƒ |  j	 d	 |  j k ƒ d
 S(   s1   Ensuring the mark is kept after an UNDO operations   
s   -=i   s   Running %s.test12_keepMark...R!   t	   newarray1i   i    s
   /newarray1N(   R	   R#   R$   R%   R&   R   R'   R   R2   R)   t   NoneR   R(   R*   RJ   (   R   t   mid(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test12_keepMark|  s    	
c         C@ s½  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d g ƒ |  j j ƒ  |  j	 ƒ  |  j
 |  j j ƒ  d ƒ |  j d	 |  j k ƒ |  j j ƒ  |  j j d d
 d g ƒ |  j j ƒ  |  j j d d d g ƒ |  j j ƒ  } |  j j d d d g ƒ |  j j ƒ  |  j
 |  j j ƒ  | ƒ |  j d	 |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j	 ƒ  |  j j ƒ  |  j j ƒ  |  j j d d d g ƒ |  j j d d d g ƒ |  j d	 |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j ƒ  |  j	 ƒ  |  j d	 |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j ƒ  d S(   s2   Checking that successive enable/disable Undo workss   
s   -=i   s)   Running %s.test13_severalEnableDisable...R!   RX   i   i    s
   /newarray1t	   newarray2t	   newarray3t	   newarray4s
   /newarray2s
   /newarray3s
   /newarray4N(   R	   R#   R$   R%   R&   R   R'   R   R(   R   R*   RJ   R)   t   disable_undoR2   (   R   RZ   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test13_severalEnableDisable‘  sL    	


(   R&   t
   __module__t   __doc__t   FalseR   R   R   R/   R1   R3   R9   R;   R<   R=   R>   R?   R@   RC   RD   RE   RI   RL   RP   RR   RS   RW   R[   R`   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR      s2   			"	#	5	]	O	"	,	*	(	"				7	"	)	9	A		t   PersistenceTestCasec           B@ s   e  Z d  Z e Z RS(   s5   Test for basic Undo/Redo operations with persistence.(   R&   Ra   Rb   t   TrueR   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRd   Ó  s   t   CreateArrayTestCasec           B@ s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s    Test for create_array operationsc         C@ sÎ   t  t |  ƒ j ƒ  |  j } | j } | j | d d d g d d ƒ| j | d d g d ƒ | j | d d	 ƒ } | j | d
 d g d ƒ | j | d d g d ƒ | j | d d ƒ | j | d d ƒ d  S(   NR   i   i   R   s   Title exampleR   s   Array titleR   s   Group titleR   s   Array title 1R   s   Array title 2R   s   Group title 2R   s   Group title 3(   R   Rf   R   R   R   R   R   (   R   R   R   R    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   Ü  s    		c         C@ sè   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j ƒ  |  j	 d
 |  j k ƒ |  j j
 ƒ  |  j	 d
 |  j k ƒ |  j |  j j j j d	 ƒ |  j |  j j j j ƒ  d d g ƒ d S(   s   Checking one action.s   
s   -=i   s   Running %s.test00...R!   R4   i   i   s   Another array 1s   /otherarray1N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R-   R*   R   R4   R   R.   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test00õ  s    	c         C@ st  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j d d
 d d g d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j j
 ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j |  j j j j d	 ƒ |  j |  j j j j d ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ d S(   s   Checking two actions.s   
s   -=i   s   Running %s.test01...R!   R4   i   i   s   Another array 1R0   i   s   Another array 2s   /otherarray1s   /otherarray2N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R-   R*   R   R4   R   R0   R.   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test01  s     	%c         C@ s   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j d d
 d d g d ƒ |  j j d d d d g d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j j
 ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j |  j j j j d	 ƒ |  j |  j j j j d ƒ |  j |  j j j j d ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j ƒ  d d g ƒ d S(   s   Checking three actions.s   
s   -=i   s   Running %s.test02...R!   R4   i   i   s   Another array 1R0   i   s   Another array 2R5   i   s   Another array 3s   /otherarray1s   /otherarray2s   /otherarray3N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R-   R*   R   R4   R   R0   R5   R.   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test020  s*    	%%c         C@ s  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d g d	 ƒ |  j j d
 d d d g d ƒ |  j j d d d d g d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j j
 ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j |  j j j j d	 ƒ |  j |  j j j j j d ƒ |  j |  j j j j j j d ƒ |  j |  j j j j ƒ  d d g ƒ |  j |  j j j j j ƒ  d d g ƒ |  j |  j j j j j j ƒ  d d g ƒ d S(   s1   Checking three actions in different depth levels.s   
s   -=i   s   Running %s.test03...R!   R4   i   i   s   Another array 1s   /agroupR0   i   s   Another array 2s   /agroup/agroup3R5   i   s   Another array 3s   /otherarray1s   /agroup/otherarray2s   /agroup/agroup3/otherarray3N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R-   R*   R   R4   R   R   R0   R   R5   R.   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test03U  s4    	%((   R&   Ra   Rb   R   Rg   Rh   Ri   Rj   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRf   Ù  s   			 	%t   CreateGroupTestCasec           B@ s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s    Test for create_group operationsc         C@ sÎ   t  t |  ƒ j ƒ  |  j } | j } | j | d d d g d d ƒ| j | d d g d ƒ | j | d d	 ƒ } | j | d
 d g d ƒ | j | d d g d ƒ | j | d d ƒ | j | d d ƒ d  S(   NR   i   i   R   s   Title exampleR   s   Array titleR   s   Group titleR   s   Array title 1R   s   Array title 2R   s   Group title 2R   s   Group title 3(   R   Rk   R   R   R   R   R   (   R   R   R   R    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   ƒ  s    		c         C@ sº   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j j
 ƒ  |  j	 d |  j k ƒ |  j |  j j j j d ƒ d	 S(
   s   Checking one action.s   
s   -=i   s   Running %s.test00...R!   t   othergroup1s   Another group 1s   /othergroup1N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R-   R*   R   Rl   t   _v_title(   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRg   œ  s    	c         C@ s  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ |  j j d d d	 ƒ |  j j ƒ  |  j	 d
 |  j k ƒ |  j	 d |  j k ƒ |  j j
 ƒ  |  j	 d
 |  j k ƒ |  j	 d |  j k ƒ |  j |  j j j j d ƒ |  j |  j j j j d	 ƒ d S(   s   Checking two actions.s   
s   -=i   s   Running %s.test01...R!   Rl   s   Another group 1t   othergroup2s   Another group 2s   /othergroup1s   /othergroup2N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R-   R*   R   Rl   Rm   Rn   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRh   ·  s     	c         C@ sv  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ |  j j d d d	 ƒ |  j j d d
 d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j j
 ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j |  j j j j d ƒ |  j |  j j j j d	 ƒ |  j |  j j j j d ƒ d S(   s   Checking three actions.s   
s   -=i   s   Running %s.test02...R!   Rl   s   Another group 1Rn   s   Another group 2t   othergroup3s   Another group 3s   /othergroup1s   /othergroup2s   /othergroup3N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R-   R*   R   Rl   Rm   Rn   Ro   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRi   ×  s*    	c         C@ s  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ |  j j d d	 d
 ƒ |  j j d d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j j
 ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j |  j j j j d ƒ |  j |  j j j j j d
 ƒ |  j |  j j j j j j d ƒ d S(   s1   Checking three actions in different depth levels.s   
s   -=i   s   Running %s.test03...R!   Rl   s   Another group 1s   /othergroup1Rn   s   Another group 2s   /othergroup1/othergroup2Ro   s   Another group 3s$   /othergroup1/othergroup2/othergroup3N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R-   R*   R   Rl   Rm   Rn   Ro   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRj   ü  s2    			(   R&   Ra   Rb   R   Rg   Rh   Ri   Rj   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRk   €  s   			 	%i
   c         C@ s0  d t  f d „  ƒ  Y} t } |  j j |  | | d d | ƒ } xm t | ƒ D]_ } t | ƒ | j d <| d | j d <| | j d <t | | d ƒ | j d <| j j	 ƒ  qJ W| j
 ƒ  | j j j ƒ  } | j j j ƒ  } | j j j ƒ  } t j r,t d	 | ƒ t d
 | j j j j ƒ t d | ƒ n  d S(   s)   Create a table under where with name namet   Indexedc           B@ sb   e  Z e d  d d d d d ƒ Z e d d d d ƒ Z e d d d d ƒ Z e d d d d ƒ Z	 RS(	   t   itemsizei   t   dfltt    t   posi   i    i   i   (
   R&   Ra   R   t   var1R   t   var2R   t   var3R   t   var4(    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRp   ,  s   Ru   i   Rv   Rw   i   Rx   s   Number of written rows:s   Number of indexed rows:s   Number of indexed rows(2):N(   R   t   minRowIndext   _v_filet   create_tableRY   R   t   strt   rowt   floatt   appendt   flusht   colsRu   t   create_indexRv   Rw   R	   R#   R$   t   indext	   nelements(   t   wheret   nameRp   t   nrowst   tablet   it	   indexrows(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   populateTable)  s$    
	t   RenameNodeTestCasec           B@ sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s   Test for rename_node operationsc         C@ sá   t  t |  ƒ j ƒ  |  j } | j } | j | d d d g d d ƒ| j | d d g d ƒ | j | d d	 ƒ } | j | d
 d g d ƒ | j | d d g d ƒ | j | d d ƒ | j | d d ƒ t |  j j d ƒ d  S(   NR   i   i   R   s   Title exampleR   s   Array titleR   s   Group titleR   s   Array title 1R   s   Array title 2R   s   Group title 2R   s   Group title 3Rˆ   (   R   RŒ   R   R   R   R   R   R‹   (   R   R   R   R    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   O  s    		c         C@ sÿ   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ d	 S(
   s3   Checking rename_node (over Groups without children)s   
s   -=i   s   Running %s.test00...s   /agroup2R   s   /agroup3s   Group title 2N(   R	   R#   R$   R%   R&   R   R'   t   rename_nodeR(   R)   R*   R   R   Rm   R-   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRg   k  s    	c         C@ sƒ  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d	 |  j k ƒ |  j	 d
 |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ d S(   s0   Checking rename_node (over Groups with children)s   
s   -=i   s   Running %s.test01...s   /agroupR   s   /agroup3s   /agroup/anarray1s   /agroup/anarray2s   /agroup/agroup3s   Group titles   /agroup3/anarray1s   /agroup3/anarray2s   /agroup3/agroup3N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R*   R   R   Rm   R-   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRh   ˆ  s&    	c         C@ s–  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d ƒ |  j j d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d	 |  j k ƒ |  j	 d
 |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d	 |  j k ƒ |  j
 |  j j j j d ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ d S(   s2   Checking rename_node (over Groups with children 2)s   
s   -=i   s   Running %s.test01b...s   /agroupR   s   /agroup3t   agroup4s   /agroup4s   /agroup/anarray1s   /agroup/anarray2s   /agroup/agroup3s   Group titles   /agroup4/anarray1s   /agroup4/anarray2s   /agroup4/agroup3N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R*   R   R   Rm   R-   RŽ   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test01b¯  s(    	c         C@ sÿ   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ d	 S(
   s"   Checking rename_node (over Leaves)s   
s   -=i   s   Running %s.test02...s   /anarrayR   s	   /anarray2s   Array titleN(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R*   R   R   R   R-   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRi   ×  s    	c         C@ s¥  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j j
 j } |  j	 | j j j d	 k	 ƒ |  j	 | j j j d	 k	 ƒ |  j	 | j j j d	 k	 ƒ |  j	 | j j j d	 k ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j	 d |  j k ƒ |  j |  j j
 j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j |  j j
 j j d ƒ |  j j
 j } |  j	 | j j j d	 k	 ƒ |  j	 | j j j d	 k	 ƒ |  j	 | j j j d	 k	 ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j	 | j j j d	 k ƒ d	 S(
   s"   Checking rename_node (over Tables)s   
s   -=i   s   Running %s.test03...s   /tablet   table2s   /table2Rp   N(   R	   R#   R$   R%   R&   R   R'   R   R(   R)   R   Rˆ   R   Ru   Rƒ   RY   Rv   Rw   Rx   R*   R„   Ry   R   R-   R   (   R   Rˆ   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRj   ô  s:    	(	   R&   Ra   Rb   R   Rg   Rh   R   Ri   Rj   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRŒ   L  s   			'	(	t   MoveNodeTestCasec           B@ sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s   Tests for move_node operationsc         C@ sá   t  t |  ƒ j ƒ  |  j } | j } | j | d d d g d d ƒ| j | d d g d ƒ | j | d d	 ƒ } | j | d
 d g d ƒ | j | d d g d ƒ | j | d d ƒ | j | d d ƒ t |  j j d ƒ d  S(   NR   i   i   R   s   Title exampleR   s   Array titleR   s   Group titleR   s   Array title 1R   s   Array title 2R   s   Group title 2R   s   Group title 3Rˆ   (   R   R‘   R   R   R   R   R   R‹   (   R   R   R   R    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   %  s    		c         C@ s  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j j j d ƒ d	 S(
   s   Checking move_node (over Leaf)s   
s   -=i   s   Running %s.test00...s   /anarrays   /agroup/agroup3s   /agroup/agroup3/anarrays   Array titleN(   R	   R#   R$   R%   R&   R   R'   t	   move_nodeR(   R)   R*   R   R   R   R-   R   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRg   A  s    	c         C@ s‰  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d	 |  j k ƒ |  j	 d
 |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j j d ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ d S(   s.   Checking move_node (over Groups with children)s   
s   -=i   s   Running %s.test01...s   /agroups   /agroup2R   s   /agroup2/agroup3s   /agroup/anarray1s   /agroup/anarray2s   /agroup/agroup3s   Group titles   /agroup2/agroup3/anarray1s   /agroup2/agroup3/anarray2s   /agroup2/agroup3/agroup3N(   R	   R#   R$   R%   R&   R   R'   R’   R(   R)   R*   R   R   Rm   R-   R   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRh   _  s(    	c         C@ sŸ  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ |  j j d d	 d
 ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j j d ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d |  j k ƒ d S(   s0   Checking move_node (over Groups with children 2)s   
s   -=i   s   Running %s.test01b...s   /agroupR!   R   s   /agroup3s   /agroup2RŽ   s   /agroup2/agroup4s   /agroup/anarray1s   /agroup/anarray2s   /agroup/agroup3s   Group titles   /agroup2/agroup4/anarray1s   /agroup2/agroup4/anarray2s   /agroup2/agroup4/agroup3N(   R	   R#   R$   R%   R&   R   R'   R’   R(   R)   R*   R   R   Rm   R-   R   RŽ   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   ‡  s*    	c         C@ s  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d	 ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j j d	 ƒ d
 S(   s    Checking move_node (over Leaves)s   
s   -=i   s   Running %s.test02...s   /anarrays   /agroup2R   s   /agroup2/anarray2s   Array titleN(   R	   R#   R$   R%   R&   R   R'   R’   R(   R)   R*   R   R   R   R-   R   R   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRi   °  s    	c         C@ s®  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j j
 j } |  j	 | j j j d
 k	 ƒ |  j	 | j j j d
 k	 ƒ |  j	 | j j j d
 k	 ƒ |  j	 | j j j d
 k ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j |  j j
 j j d	 ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j |  j j
 j j j d	 ƒ |  j j
 j j } |  j	 | j j j d
 k	 ƒ |  j	 | j j j d
 k	 ƒ |  j	 | j j j d
 k	 ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j	 | j j j d
 k ƒ d
 S(   s    Checking move_node (over Tables)s   
s   -=i   s   Running %s.test03...s   /tables   /agroup2R   s   /agroup2/table2Rp   N(   R	   R#   R$   R%   R&   R   R'   R’   R(   R)   R   Rˆ   R   Ru   Rƒ   RY   Rv   Rw   Rx   R*   R„   Ry   R   R-   R   R   (   R   Rˆ   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRj   Î  s:    	(	   R&   Ra   Rb   R   Rg   Rh   R   Ri   Rj   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR‘   "  s   			(	)	t   RemoveNodeTestCasec           B@ sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s   Test for remove_node operationsc         C@ sá   t  t |  ƒ j ƒ  |  j } | j } | j | d d d g d d ƒ| j | d d g d ƒ | j | d d	 ƒ } | j | d
 d g d ƒ | j | d d g d ƒ | j | d d ƒ | j | d d ƒ t |  j j d ƒ d  S(   NR   i   i   R   s   Title exampleR   s   Array titleR   s   Group titleR   s   Array title 1R   s   Array title 2R   s   Group title 2R   s   Group title 3Rˆ   (   R   R“   R   R   R   R   R   R‹   (   R   R   R   R    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   ÿ  s    		c         C@ s´   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ d S(   s    Checking remove_node (over Leaf)s   
s   -=i   s   Running %s.test00...s   /anarrays   Array titleN(   R	   R#   R$   R%   R&   R   R'   t   remove_nodeR(   R)   R*   R   R   R   R-   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRg     s    	c         C@ s  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d ƒ |  j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j
 |  j j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ d	 S(
   s*   Checking remove_node (over several Leaves)s   
s   -=i   s   Running %s.test00b...s   /anarrays   /agroup/anarray2s   Array titles   Array title 2N(   R	   R#   R$   R%   R&   R   R'   R”   R(   R)   R*   R   R   R   R   R   R-   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test00b5  s    	c         C@ s‡  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j j
 j } |  j	 | j j j d k	 ƒ |  j	 | j j j d k	 ƒ |  j	 | j j j d k	 ƒ |  j	 | j j j d k ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j |  j j
 j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ d S(   s"   Checking remove_node (over Tables)s   
s   -=i   s   Running %s.test00c...s   /tableRp   N(   R	   R#   R$   R%   R&   R   R'   R”   R(   R)   R   Rˆ   R   Ru   Rƒ   RY   Rv   Rw   Rx   R*   R„   Ry   R   R-   (   R   Rˆ   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test00cT  s$    	c         C@ s>  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ|  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d	 |  j k ƒ |  j	 d
 |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d	 |  j k ƒ |  j	 d
 |  j k ƒ d S(   s0   Checking remove_node (over Groups with children)s   
s   -=i   s   Running %s.test01...s   /agroupt	   recursivei   s   /agroup/anarray1s   /agroup/anarray2s   /agroup/agroup3s   Group titleN(   R	   R#   R$   R%   R&   R   R'   R”   R(   R)   R*   R   R   Rm   R-   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRh   v  s     	c         C@ sz  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ|  j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d	 |  j k ƒ |  j	 d
 |  j k ƒ |  j	 d |  j k ƒ |  j
 |  j j j j d ƒ |  j j ƒ  |  j	 d |  j k ƒ |  j	 d |  j k ƒ |  j	 d	 |  j k ƒ |  j	 d
 |  j k ƒ |  j	 d |  j k ƒ d S(   s2   Checking remove_node (over Groups with children 2)s   
s   -=i   s   Running %s.test01b...s   /agroupR—   i   s   /agroup2s   /agroup/anarray1s   /agroup/anarray2s   /agroup/agroup3s   Group titleN(   R	   R#   R$   R%   R&   R   R'   R”   R(   R)   R*   R   R   Rm   R-   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   –  s&    	(	   R&   Ra   Rb   R   Rg   R•   R–   Rh   R   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR“   ü  s   				"	 t   CopyNodeTestCasec           B@ sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s0   Tests for copy_node and copy_children operationsc         C@ sá   t  t |  ƒ j ƒ  |  j } | j } | j | d d d g d d ƒ| j | d d g d ƒ | j | d d	 ƒ } | j | d
 d g d ƒ | j | d d g d ƒ | j | d d ƒ | j | d d ƒ t |  j j d ƒ d  S(   NR   i   i   R   s   Title exampleR   s   Array titleR   s   Group titleR   s   Array title 1R   s   Array title 2R   s   Group title 2R   s   Group title 3Rˆ   (   R   R˜   R   R   R   R   R   R‹   (   R   R   R   R    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   Á  s    		c         C@ s¿   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d ƒ } |  j j ƒ  |  j	 d |  j k ƒ |  j j
 ƒ  |  j	 d |  j k ƒ |  j	 |  j j j j j | k ƒ d S(	   s    Checking copy_node (over Leaves)s   
s   -=i   s   Running %s.test00_copyLeaf...s   /anarrays   /agroup/agroup3s   /agroup/agroup3/anarrayN(   R	   R#   R$   R%   R&   R   R'   t	   copy_nodeR(   R)   R-   R   R   R   R   (   R   t   new_node(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test00_copyLeafÝ  s    	c         C@ s   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  t j d d t	 ƒ|  j j
 d d d	 t ƒ} t j d
 d t	 ƒ|  j d |  j k ƒ |  j j j j j } |  j | j d ƒ |  j | j j j d k	 ƒ |  j | j j j d k	 ƒ |  j | j j j d k	 ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j d k ƒ |  j j ƒ  |  j j j } |  j | j j j d k	 ƒ |  j | j j j d k	 ƒ |  j | j j j d k	 ƒ |  j | j j j d k ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j d |  j k ƒ |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j j j j j } |  j | j d ƒ |  j | j j j d k	 ƒ |  j | j j j d k	 ƒ |  j | j j j d k	 ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j j t ƒ |  j | j j j d k ƒ d S(   s    Checking copy_node (over Tables)s   
s   -=i   s   Running %s.test00b_copyTable...t   ignoret   categorys   /tables   /agroup/agroup3t   propindexest   defaults   /agroup/agroup3/tableRp   N(   R	   R#   R$   R%   R&   R   R'   t   warningst   filterwarningst   UserWarningR™   Re   R)   R   R   R   Rˆ   R*   R   R   Ru   Rƒ   RY   Rv   Rw   R„   Ry   Rx   R(   R-   (   R   Rˆ   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test00b_copyTable÷  sP    		c         C@ sF  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d d t ƒ} |  j j	 ƒ  |  j
 d	 |  j k ƒ |  j
 d
 |  j k ƒ |  j
 d |  j k ƒ |  j
 d |  j k ƒ |  j j ƒ  |  j
 d	 |  j k ƒ |  j
 d
 |  j k ƒ |  j
 d |  j k ƒ |  j
 d |  j k ƒ |  j
 |  j j j | k ƒ d S(   s   Copying a group (recursively).s   
s   -=i   s   Running %s.test01_copyGroup...s   /agroupt   newnamet   acopyR—   s   /acopys   /acopy/anarray1s   /acopy/anarray2s   /acopy/agroup3N(   R	   R#   R$   R%   R&   R   R'   R™   Re   R(   R)   R-   R   R¥   (   R   Rš   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test01_copyGroup0  s"    		c         C@ sÁ   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j j } |  j j	 d d d d t
 ƒ} |  j j ƒ  |  j |  j j j | k ƒ |  j j ƒ  |  j |  j j j | k ƒ d	 S(
   s(   Copying a leaf, overwriting destination.s   
s   -=i   s&   Running %s.test02_copyLeafOverwrite...s   /anarrayR¤   R   t	   overwriteN(   R	   R#   R$   R%   R&   R   R'   R   R   R™   Re   R(   R)   R-   (   R   t   oldNodeRš   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test02_copyLeafOverwriteQ  s    		c         C@ sù   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d t ƒ|  j j	 ƒ  |  j
 d |  j k ƒ |  j
 d	 |  j k ƒ |  j
 d
 |  j k ƒ |  j j ƒ  |  j
 d |  j k ƒ |  j
 d	 |  j k ƒ |  j
 d
 |  j k ƒ d S(   s   Copying the children of a groups   
s   -=i   s!   Running %s.test03_copyChildren...s   /agroups   /agroup2R—   s   /agroup2/anarray1s   /agroup2/anarray2s   /agroup2/agroup3N(   R	   R#   R$   R%   R&   R   R'   t   copy_childrenRe   R(   R)   R-   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test03_copyChildreno  s    	(	   R&   Ra   Rb   R   R›   R£   R¦   R©   R«   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR˜   ¾  s   			9	!	t   ComplexTestCasec           B@ sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s!   Tests for a mix of all operationsc         C@ sÎ   t  t |  ƒ j ƒ  |  j } | j } | j | d d d g d d ƒ| j | d d g d ƒ | j | d d	 ƒ } | j | d
 d g d ƒ | j | d d g d ƒ | j | d d ƒ | j | d d ƒ d  S(   NR   i   i   R   s   Title exampleR   s   Array titleR   s   Group titleR   s   Array title 1R   s   Array title 2R   s   Group title 2R   s   Group title 3(   R   R¬   R   R   R   R   R   (   R   R   R   R    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   ‘  s    		c         C@ s)  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j |  j j d d g d ƒ |  j j	 |  j j d d	 ƒ |  j j
 d
 d ƒ } |  j j d d d d ƒ} |  j j d d ƒ |  j j
 d
 d ƒ } |  j j d ƒ |  j j ƒ  |  j d |  j k ƒ |  j d
 |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j ƒ  |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j |  j j j j | k ƒ |  j d |  j k ƒ |  j d |  j k ƒ d S(   sk   Mix of create_array, create_group, renameNone, move_node,
        remove_node, copy_node and copy_children.s   
s   -=i   s   Running %s.test00...t   anarray3i   s   Array title 3R   s   Group title 3s	   /anarray3s   /agroup/agroup3s   /agroups   /agroup3R—   s   /anarrayt   anarray4s	   /anarray4s   /agroup/agroup3/anarray3s   /agroup/anarray3s   /agroup3/agroup3/anarray3s   /agroup3/anarray3N(   R	   R#   R$   R%   R&   R   R'   R   R   R   R™   Rª   R   R”   R(   R)   R-   R   R­   (   R   Rš   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRg   ª  s8    		c         C@ sd  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d ƒ |  j j |  j j	 d d g d ƒ |  j j d ƒ |  j j |  j j	 d d	 g d
 ƒ |  j j d ƒ |  j j |  j j	 d d g d ƒ |  j j
 ƒ  |  j |  j j	 j j d ƒ |  j |  j j	 j d g ƒ |  j j ƒ  |  j |  j j	 j j d ƒ |  j |  j j	 j d g ƒ d S(   s*   Test with multiple generations (Leaf case)s   
s   -=i   s   Running %s.test01...s   /anarrayR   i   s   Array title 2i   s   Array title 3i   s   Array title 4s   Array titlei   N(   R	   R#   R$   R%   R&   R   R'   R”   R   R   R(   R*   R   R   R-   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRh   Þ  s&    	c         C@ sl  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d ƒ |  j j |  j j	 d d ƒ |  j j d ƒ |  j j |  j j	 d d ƒ |  j j d ƒ |  j j |  j j	 d d	 ƒ |  j j |  j j	 j
 d
 d ƒ |  j j ƒ  |  j |  j j	 j
 j d ƒ |  j d |  j k ƒ |  j j ƒ  |  j |  j j	 j
 j d	 ƒ |  j |  j j	 j
 j j d ƒ d S(   s+   Test with multiple generations (Group case)s   
s   -=i   s   Running %s.test02...s   /agroup2R   s   Group title 22s   Group title 3s   Group title 4t   agroup5s   Group title 5s   Group title 2N(   R	   R#   R$   R%   R&   R   R'   R”   R   R   R   R(   R*   Rm   R)   R-   R¯   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRi   	  s&    	c         C@ sö  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j d d d ƒ|  j j |  j j	 d d	 ƒ |  j j d ƒ |  j j |  j j	 d d
 ƒ |  j j d ƒ |  j j |  j j	 d d ƒ |  j j |  j j	 j
 d d ƒ |  j j ƒ  |  j d |  j k ƒ |  j |  j j	 j
 j d ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j d |  j k ƒ |  j j ƒ  |  j d |  j k ƒ |  j |  j j	 j
 j d ƒ |  j d |  j k ƒ |  j |  j j	 j
 j j d ƒ d S(   s=   Test with multiple generations (Group case, recursive remove)s   
s   -=i   s   Running %s.test03...s   /agroupR—   i   R   s   Group title 2s   Group title 3s   Group title 4R¯   s   Group title 5s   Group titles   /agroup/anarray1s   /agroup/anarray2s   /agroup/agroup3s   /agroup/agroup5N(   R	   R#   R$   R%   R&   R   R'   R”   R   R   R   R(   R)   R*   Rm   R-   R¯   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRj   3	  s2    	c         C@ s'  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j ƒ  |  j j |  j j d d ƒ |  j j |  j j j	 d d ƒ |  j j
 d	 d
 d ƒ|  j j |  j j d d ƒ |  j j ƒ  |  j d	 |  j k ƒ |  j j ƒ  |  j |  j j j	 j d ƒ |  j d	 |  j k ƒ |  j d |  j k ƒ d S(   sM   Test with multiple generations (Group case, recursive remove,
        case 2)s   
s   -=i   s   Running %s.test03b...R   s   Group title 3RŽ   s   Group title 4s   /agroup3R—   i   s   /agroup/agroup4N(   R	   R#   R$   R%   R&   R   R'   R   R   R   R”   R(   R)   R-   R*   Rm   (   R   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test03be	  s    	(	   R&   Ra   Rb   R   Rg   Rh   Ri   Rj   R°   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR¬   Ž  s   		4	(	-	2t   AttributesTestCasec           B@ sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s!   Tests for operation on attributesc         C@ sY   t  t |  ƒ j ƒ  |  j j d d d d g ƒ } | j } d | _ d | _ d | _ d  S(   NR!   R   i   i   i
   i   i   (	   R   R±   R   R   R   t   attrst   attr_1t   attr_2t   attr_3(   R   R   R²   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   ‹	  s    			c         C@ sã   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j j } | j } |  j j	 ƒ  t
 | d d ƒ |  j d | k ƒ |  j | j d ƒ |  j j ƒ  |  j d | k ƒ |  j j ƒ  |  j d | k ƒ |  j | j d ƒ d S(   s   Setting a nonexistent attributes   
s   -=i   s   Running %s.test00_setAttr...t   attr_0i    N(   R	   R#   R$   R%   R&   R   R   R   R²   R'   t   setattrR)   R*   R¶   R(   R-   (   R   R   R²   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test00_setAttr—	  s    		c         C@ sö   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j j } | j } |  j j	 ƒ  t
 | d d ƒ |  j d | k ƒ |  j | j d ƒ |  j j ƒ  |  j d | k ƒ |  j | j d ƒ |  j j ƒ  |  j d | k ƒ |  j | j d ƒ d S(	   s   Setting an existing attributes   
s   -=i   s$   Running %s.test01_setAttrExisting...R³   i   i
   N(   R	   R#   R$   R%   R&   R   R   R   R²   R'   R·   R)   R*   R³   R(   R-   (   R   R   R²   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test01_setAttrExisting«	  s     		c         C@ sÍ   t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j j } | j } |  j j	 ƒ  t
 | d ƒ |  j d | k ƒ |  j j ƒ  |  j d | k ƒ |  j | j d ƒ |  j j ƒ  |  j d | k ƒ d S(   s   Removing an attributes   
s   -=i   s   Running %s.test02_delAttr...R³   i
   N(   R	   R#   R$   R%   R&   R   R   R   R²   R'   t   delattrR)   R(   R*   R³   R-   (   R   R   R²   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test02_delAttrÁ	  s    		c         C@ sŒ  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j j } d | _ d | _	 |  j j j
 } | j } |  j j ƒ  | j |  j j ƒ |  j | j d ƒ |  j | j	 d ƒ |  j | j d ƒ |  j | j d ƒ |  j j ƒ  |  j | j d ƒ |  j | j	 d ƒ |  j d	 | k ƒ |  j d
 | k ƒ |  j j ƒ  |  j | j d ƒ |  j | j	 d ƒ |  j | j d ƒ |  j | j d ƒ d S(   s   Copying an attribute sets   
s   -=i   s"   Running %s.test03_copyNodeAttrs...i    id   i
   i   R´   Rµ   N(   R	   R#   R$   R%   R&   R   R   t   _v_attrsR¶   R³   R   R²   R'   t   _f_copyR*   R´   Rµ   R(   R)   R-   (   R   t   rattrsR   R²   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test03_copyNodeAttrsÔ	  s2    				c         C@ s0  t  j r1 t d d d ƒ t d |  j j ƒ n  |  j j j } | j } |  j j	 ƒ  d | _
 |  j j d ƒ |  j j d d d	 g ƒ } d
 | j _
 |  j j ƒ  |  j d |  j j j j k ƒ |  j |  j j j j j
 d ƒ |  j j ƒ  |  j d |  j j j j k ƒ |  j |  j j j j j
 d
 ƒ d S(   s+   Replacing a node with a rewritten attributes   
s   -=i   s    Running %s.test04_replaceNode...i   s   /arrayR!   R   i   i   R³   i
   N(   R	   R#   R$   R%   R&   R   R   R   R²   R'   R³   R”   R   R(   R)   R*   R-   (   R   R   R²   t   arr(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test04_replaceNodeô	  s     			(	   R&   Ra   Rb   R   R¸   R¹   R»   R¿   RÁ   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR±   ˆ	  s   					 t   NotLoggedTestCasec           B@ s<   e  Z d  Z d e e j f d „  ƒ  YZ d „  Z d „  Z RS(   s   Test not logged nodes.t   NotLoggedArrayc           B@ s   e  Z RS(    (   R&   Ra   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÃ   
  s   c         C@ sË   |  j  j d d ƒ |  j  j ƒ  |  j |  j  j d d g |  j ƒ  ƒ } |  j  j ƒ  |  j d |  j  k ƒ | j d ƒ |  j  j ƒ  |  j d |  j  k ƒ | j	 ƒ  |  j  j ƒ  |  j d |  j  k ƒ d S(	   s5   Performing hierarchy operations on a not logged node.R!   t   tgroupt   testi   s   /tests   /tgroups   /tgroup/testN(
   R   R   R'   RÃ   R   t   _getMethodNameR(   R)   t   movet   remove(   R   RÀ   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test00_hierarchy
  s    
c         C@ sÅ   |  j  |  j j d d g |  j ƒ  ƒ } |  j j ƒ  d | j _ |  j j ƒ  |  j | j j d ƒ d | j _ |  j j ƒ  |  j | j j d ƒ | j ` |  j j ƒ  |  j	 t
 t | j d ƒ d S(   s5   Performing attribute operations on a not logged node.RÅ   i   t   bart   bazt   fooN(   RÃ   R   R   RÆ   R'   R¼   RÌ   R(   R*   RM   t   AttributeErrort   getattr(   R   RÀ   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test01_attributes'
  s    	(	   R&   Ra   Rb   R   RN   t   ArrayRÃ   RÉ   RÏ   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÂ   
  s   	t   CreateParentsTestCasec           B@ sM   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   s    Test the ``createparents`` flag.c         C@ s?   t  t |  ƒ j ƒ  |  j j d d ƒ } |  j j | d ƒ d  S(   NR!   t   g1t   g2(   R   RÑ   R   R   R   (   R   RÒ   (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR   A
  s    c         @ s   t  ‡  f d †  | Dƒ ƒ S(   s.   Return a set of the existing paths in `paths`.c         3@ s$   |  ] } | ˆ  j  k r | Vq d  S(   N(   R   (   t   .0t   path(   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pys	   <genexpr>H
  s    (   t	   frozenset(   R   t   paths(    (   R   s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   existingF
  s    c         C@ s¯   | ƒ  |  j  j ƒ  d d d d g } x‚ | D]z } |  j | ƒ } | | ƒ |  j | ƒ } |  j | j | ƒ ƒ |  j  j ƒ  | | ƒ |  j | ƒ } |  j | | ƒ q- Wd  S(   Ns   /g1s   /g1/g2s	   /g1/g2/g3s   /g1/g2/g3/g4(   R   R'   RØ   R)   t
   issupersetR(   R*   (   R   t   doitt   pret   postR×   t   newpatht   beforet   after(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   basetestJ
  s    

c         @ s>   d „  } ‡  f d †  } ‡  f d †  } ˆ  j  | | | ƒ d S(   s   Test creating a node.c           S@ s   d  S(   N(    (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÛ   ]
  s    c         @ sB   ˆ  j  j |  d d g d t ƒˆ  j t |  d ƒ ˆ  j  k ƒ d  S(   NR   i   t   createparents(   R   R   Re   R)   R   (   RÝ   (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÚ   `
  s    c         @ s#   ˆ  j  t |  d ƒ ˆ  j k ƒ d  S(   NR   (   R)   R   R   (   RÝ   (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÜ   d
  s    N(   Rà   (   R   RÛ   RÚ   RÜ   (    (   R   s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test00_createZ
  s    	c         @ sD   ‡  f d †  } ‡  f d †  } ‡  f d †  } ˆ  j  | | | ƒ d S(   s   Test moving a node.c           @ s   ˆ  j  j d d d g ƒ d  S(   NR!   R   i   (   R   R   (    (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÛ   k
  s    c         @ sR   ˆ  j  j d |  d t ƒˆ  j d ˆ  j  k ƒ ˆ  j t |  d ƒ ˆ  j  k ƒ d  S(   Ns   /arrayRá   R   (   R   R’   Re   R)   R   (   RÝ   (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÚ   n
  s    c         @ s9   ˆ  j  d ˆ  j k ƒ ˆ  j  t |  d ƒ ˆ  j k ƒ d  S(   Ns   /arrayR   (   R)   R   R   (   RÝ   (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÜ   s
  s    N(   Rà   (   R   RÛ   RÚ   RÜ   (    (   R   s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test01_moveh
  s    c         @ sD   ‡  f d †  } ‡  f d †  } ‡  f d †  } ˆ  j  | | | ƒ d S(   s   Test copying a node.c           @ s   ˆ  j  j d d d g ƒ d  S(   NR!   R   i   (   R   R   (    (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÛ   {
  s    c         @ s<   ˆ  j  j d |  d t ƒˆ  j t |  d ƒ ˆ  j  k ƒ d  S(   Ns   /arrayRá   R   (   R   R™   Re   R)   R   (   RÝ   (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÚ   ~
  s    c         @ s#   ˆ  j  t |  d ƒ ˆ  j k ƒ d  S(   NR   (   R)   R   R   (   RÝ   (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÜ   ‚
  s    N(   Rà   (   R   RÛ   RÚ   RÜ   (    (   R   s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   test02_copyx
  s    c         @ sD   ‡  f d †  } ‡  f d †  } ‡  f d †  } ˆ  j  | | | ƒ d S(   s%   Test copying the children of a group.c          @ sK   ˆ  j  j d d ƒ }  ˆ  j  j |  d d g ƒ ˆ  j  j |  d d g ƒ d  S(   NR!   R    t   array1i   t   array2(   R   R   R   (   t   g(   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÛ   ‰
  s    c         @ s[   ˆ  j  j d |  d t ƒˆ  j t |  d ƒ ˆ  j  k ƒ ˆ  j t |  d ƒ ˆ  j  k ƒ d  S(   Ns   /groupRá   Rå   Ræ   (   R   Rª   Re   R)   R   (   RÝ   (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÚ   Ž
  s    c         @ sB   ˆ  j  t |  d ƒ ˆ  j k ƒ ˆ  j  t |  d ƒ ˆ  j k ƒ d  S(   NRå   Ræ   (   R)   R   R   (   RÝ   (   R   (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÜ   “
  s    N(   Rà   (   R   RÛ   RÚ   RÜ   (    (   R   s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyR«   †
  s    (
   R&   Ra   Rb   R   RØ   Rà   Râ   Rã   Rä   R«   (    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyRÑ   >
  s   						c          C@ sA  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 ƒ ƒ q Wt j r=n  |  S(   Ni   (   R
   t	   TestSuiteR   t   addTestt	   makeSuiteR   Rd   Rf   Rk   RŒ   R‘   R“   R˜   R±   R¬   RÂ   RÑ   R	   t   heavy(   t   theSuitet   nitert   n(    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   suite™
  s$    	t   __main__t   defaultTestRï   (,   t
   __future__R    R   R    RN   R   R   R   R   R   t   tables.nodeR   t   tables.pathR   t   tables.testsR	   t   tables.tests.commonR
   R   t   TestCaset	   six.movesR   t   TempFileMixinR   Rd   Rf   Rk   Ry   R‹   RŒ   R‘   R“   R˜   R¬   R±   RÂ   RÑ   Rï   R&   t   syst
   parse_argvt   argvt   print_versionst   main(    (    (    s8   lib/python2.7/site-packages/tables/tests/test_do_undo.pyt   <module>   sB   (ÿ ÿ ÿ Ä§¦	#ÖÚÂÐúƒ3[	
