<s> from __future__ import print_function <EOL> from __future__ import absolute_import <EOL> import warnings <EOL> import tables <EOL> from tables import IsDescription , StringCol , BoolCol , IntCol , FloatCol <EOL> from tables . node import NotLoggedMixin <EOL> from tables . path import join_path <EOL> from tables . tests import common <EOL> from tables . tests . common import unittest <EOL> from tables . tests . common import PyTablesTestCase as TestCase <EOL> from six . moves import range <EOL> class BasicTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> _reopen_flag = False <EOL> """<STR_LIT>""" <EOL> def _do_reopen ( self ) : <EOL> if self . _reopen_flag : <EOL> self . _reopen ( '<STR_LIT>' ) <EOL> def setUp ( self ) : <EOL> super ( BasicTestCase , self ) . setUp ( ) <EOL> h5file = self . h5file <EOL> root = h5file . root <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , title = "<STR_LIT>" ) <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> ] , "<STR_LIT>" ) <EOL> group = h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_group ( group , '<STR_LIT>' , "<STR_LIT>" ) <EOL> def test00_simple ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertEqual ( self . h5file . _curaction , <NUM_LIT:0> ) <EOL> self . assertEqual ( self . h5file . _curmark , <NUM_LIT:0> ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . redo ( ) <EOL> if common . verbose : <EOL> print ( "<STR_LIT>" , self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . _curaction , <NUM_LIT:1> ) <EOL> self . assertEqual ( self . h5file . _curmark , <NUM_LIT:0> ) <EOL> def test01_twice ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertEqual ( self . h5file . _curaction , <NUM_LIT:0> ) <EOL> self . assertEqual ( self . h5file . _curmark , <NUM_LIT:0> ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:4> , <NUM_LIT:5> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . _curaction , <NUM_LIT:2> ) <EOL> self . assertEqual ( self . h5file . _curmark , <NUM_LIT:0> ) <EOL> def test02_twice2 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . _curaction , <NUM_LIT:3> ) <EOL> self . assertEqual ( self . h5file . _curmark , <NUM_LIT:1> ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertEqual ( self . h5file . _curaction , <NUM_LIT:2> ) <EOL> self . assertEqual ( self . h5file . _curmark , <NUM_LIT:1> ) <EOL> self . h5file . undo ( ) <EOL> self . assertEqual ( self . h5file . _curaction , <NUM_LIT:0> ) <EOL> self . assertEqual ( self . h5file . _curmark , <NUM_LIT:0> ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . assertEqual ( self . h5file . _curaction , <NUM_LIT:2> ) <EOL> self . assertEqual ( self . h5file . _curmark , <NUM_LIT:1> ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:4> , <NUM_LIT:5> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . _curaction , <NUM_LIT:3> ) <EOL> self . assertEqual ( self . h5file . _curmark , <NUM_LIT:1> ) <EOL> def test03_6times3marks ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:7> , <NUM_LIT:8> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:8> , <NUM_LIT:9> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:4> , <NUM_LIT:5> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . read ( ) , [ <NUM_LIT:5> , <NUM_LIT:6> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray4 . read ( ) , [ <NUM_LIT:6> , <NUM_LIT:7> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray5 . read ( ) , [ <NUM_LIT:7> , <NUM_LIT:8> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray6 . read ( ) , [ <NUM_LIT:8> , <NUM_LIT:9> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray4 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray5 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray6 . title , "<STR_LIT>" ) <EOL> def test04_6times3marksro ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> if common . verbose : <EOL> print ( "<STR_LIT>" , self . h5file . walk_nodes ( ) ) <EOL> self . h5file . mark ( ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:7> , <NUM_LIT:8> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:8> , <NUM_LIT:9> ] , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:4> , <NUM_LIT:5> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray5 . read ( ) , [ <NUM_LIT:7> , <NUM_LIT:8> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray6 . read ( ) , [ <NUM_LIT:8> , <NUM_LIT:9> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray5 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray6 . title , "<STR_LIT>" ) <EOL> def test05_destructive ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . title , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . read ( ) , [ <NUM_LIT:5> , <NUM_LIT:6> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . title , "<STR_LIT>" ) <EOL> def test05b_destructive ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . title , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . read ( ) , [ <NUM_LIT:5> , <NUM_LIT:6> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . title , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test05c_destructive ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . h5file . undo ( ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test05d_destructive ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . undo ( <NUM_LIT:0> ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test05e_destructive ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( <NUM_LIT:0> ) <EOL> self . _do_reopen ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test05f_destructive ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> self . h5file . undo ( ) <EOL> self . _do_reopen ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> newarr = self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> if not self . _reopen_flag : <EOL> self . assertTrue ( self . h5file . root . newarray is newarr ) <EOL> def test06_totalunwind ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . undo ( <NUM_LIT:0> ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test07_totalrewind ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( <NUM_LIT:0> ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . redo ( - <NUM_LIT:1> ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:4> , <NUM_LIT:5> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . title , "<STR_LIT>" ) <EOL> def test08_marknames ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . undo ( "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . redo ( - <NUM_LIT:1> ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:4> , <NUM_LIT:5> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . read ( ) , [ <NUM_LIT:5> , <NUM_LIT:6> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray4 . read ( ) , [ <NUM_LIT:6> , <NUM_LIT:7> ] ) <EOL> def test08_initialmark ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> initmid = self . h5file . get_current_mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( initmid ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( - <NUM_LIT:1> ) <EOL> self . _do_reopen ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:4> , <NUM_LIT:5> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . title , "<STR_LIT>" ) <EOL> def test09_marknames ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( "<STR_LIT>" ) <EOL> with self . assertRaises ( tables . UndoRedoError ) : <EOL> self . h5file . undo ( "<STR_LIT>" ) <EOL> self . h5file . redo ( "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> with self . assertRaises ( tables . UndoRedoError ) : <EOL> self . h5file . redo ( "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test10_goto ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> self . h5file . goto ( "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . goto ( "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . goto ( "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . goto ( - <NUM_LIT:1> ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:4> , <NUM_LIT:5> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . read ( ) , [ <NUM_LIT:5> , <NUM_LIT:6> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray4 . read ( ) , [ <NUM_LIT:6> , <NUM_LIT:7> ] ) <EOL> def test10_gotoint ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:4> , <NUM_LIT:5> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:5> , <NUM_LIT:6> ] , "<STR_LIT>" ) <EOL> self . h5file . mark ( "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:6> , <NUM_LIT:7> ] , "<STR_LIT>" ) <EOL> self . h5file . goto ( <NUM_LIT:1> ) <EOL> self . _do_reopen ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . goto ( <NUM_LIT:0> ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . goto ( <NUM_LIT:3> ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . goto ( <NUM_LIT:2> ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . goto ( - <NUM_LIT:1> ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:4> , <NUM_LIT:5> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . read ( ) , [ <NUM_LIT:5> , <NUM_LIT:6> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray4 . read ( ) , [ <NUM_LIT:6> , <NUM_LIT:7> ] ) <EOL> def test11_contiguous ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> m1 = self . h5file . mark ( ) <EOL> m2 = self . h5file . mark ( ) <EOL> self . assertNotEqual ( m1 , m2 ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . undo ( m1 ) <EOL> self . assertEqual ( self . h5file . get_current_mark ( ) , m1 ) <EOL> self . h5file . redo ( m2 ) <EOL> self . assertEqual ( self . h5file . get_current_mark ( ) , m2 ) <EOL> self . h5file . goto ( m1 ) <EOL> self . assertEqual ( self . h5file . get_current_mark ( ) , m1 ) <EOL> self . h5file . goto ( m2 ) <EOL> self . assertEqual ( self . h5file . get_current_mark ( ) , m2 ) <EOL> self . h5file . goto ( - <NUM_LIT:1> ) <EOL> self . _do_reopen ( ) <EOL> self . assertEqual ( self . h5file . get_current_mark ( ) , m2 ) <EOL> self . h5file . goto ( <NUM_LIT:0> ) <EOL> self . assertEqual ( self . h5file . get_current_mark ( ) , <NUM_LIT:0> ) <EOL> def test12_keepMark ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> mid = self . h5file . mark ( ) <EOL> self . assertTrue ( mid is not None ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . undo ( ) <EOL> self . assertEqual ( self . h5file . get_current_mark ( ) , <NUM_LIT:0> ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> def test13_severalEnableDisable ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> self . h5file . undo ( ) <EOL> self . _do_reopen ( ) <EOL> self . assertEqual ( self . h5file . get_current_mark ( ) , <NUM_LIT:0> ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . h5file . disable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> mid = self . h5file . mark ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> self . h5file . undo ( ) <EOL> self . assertEqual ( self . h5file . get_current_mark ( ) , mid ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . _do_reopen ( ) <EOL> self . h5file . disable_undo ( ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . h5file . undo ( ) <EOL> self . _do_reopen ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . h5file . disable_undo ( ) <EOL> class PersistenceTestCase ( BasicTestCase ) : <EOL> """<STR_LIT>""" <EOL> _reopen_flag = True <EOL> class CreateArrayTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( CreateArrayTestCase , self ) . setUp ( ) <EOL> h5file = self . h5file <EOL> root = h5file . root <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , title = "<STR_LIT>" ) <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> ] , "<STR_LIT>" ) <EOL> group = h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_group ( group , '<STR_LIT>' , "<STR_LIT>" ) <EOL> def test00 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:1> , <NUM_LIT:2> ] ) <EOL> def test01 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:2> , <NUM_LIT:3> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:1> , <NUM_LIT:2> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:2> , <NUM_LIT:3> ] ) <EOL> def test02 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:2> , <NUM_LIT:3> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:1> , <NUM_LIT:2> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray2 . read ( ) , [ <NUM_LIT:2> , <NUM_LIT:3> ] ) <EOL> self . assertEqual ( self . h5file . root . otherarray3 . read ( ) , [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> def test03 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT>' , '<STR_LIT>' , <EOL> [ <NUM_LIT:2> , <NUM_LIT:3> ] , "<STR_LIT>" ) <EOL> self . h5file . create_array ( '<STR_LIT>' , '<STR_LIT>' , <EOL> [ <NUM_LIT:3> , <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . agroup . otherarray2 . title , <EOL> "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . agroup . agroup3 . otherarray3 . title , <EOL> "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . otherarray1 . read ( ) , [ <NUM_LIT:1> , <NUM_LIT:2> ] ) <EOL> self . assertEqual ( self . h5file . root . agroup . otherarray2 . read ( ) , [ <NUM_LIT:2> , <NUM_LIT:3> ] ) <EOL> self . assertEqual ( self . h5file . root . agroup . agroup3 . otherarray3 . read ( ) , <EOL> [ <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> class CreateGroupTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( CreateGroupTestCase , self ) . setUp ( ) <EOL> h5file = self . h5file <EOL> root = h5file . root <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , title = "<STR_LIT>" ) <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> ] , "<STR_LIT>" ) <EOL> group = h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_group ( group , '<STR_LIT>' , "<STR_LIT>" ) <EOL> def test00 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . othergroup1 . _v_title , <EOL> "<STR_LIT>" ) <EOL> def test01 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . othergroup1 . _v_title , <EOL> "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . othergroup2 . _v_title , <EOL> "<STR_LIT>" ) <EOL> def test02 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . othergroup1 . _v_title , <EOL> "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . othergroup2 . _v_title , <EOL> "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . othergroup3 . _v_title , <EOL> "<STR_LIT>" ) <EOL> def test03 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . create_group ( <EOL> '<STR_LIT>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . create_group ( <EOL> '<STR_LIT>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( <EOL> "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . othergroup1 . _v_title , <EOL> "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . othergroup1 . othergroup2 . _v_title , <EOL> "<STR_LIT>" ) <EOL> self . assertEqual ( <EOL> self . h5file . root . othergroup1 . othergroup2 . othergroup3 . _v_title , <EOL> "<STR_LIT>" ) <EOL> minRowIndex = <NUM_LIT:10> <EOL> def populateTable ( where , name ) : <EOL> """<STR_LIT>""" <EOL> class Indexed ( IsDescription ) : <EOL> var1 = StringCol ( itemsize = <NUM_LIT:4> , dflt = b"<STR_LIT>" , pos = <NUM_LIT:1> ) <EOL> var2 = BoolCol ( dflt = <NUM_LIT:0> , pos = <NUM_LIT:2> ) <EOL> var3 = IntCol ( dflt = <NUM_LIT:0> , pos = <NUM_LIT:3> ) <EOL> var4 = FloatCol ( dflt = <NUM_LIT:0> , pos = <NUM_LIT:4> ) <EOL> nrows = minRowIndex <EOL> table = where . _v_file . create_table ( where , name , Indexed , "<STR_LIT>" , <EOL> None , nrows ) <EOL> for i in range ( nrows ) : <EOL> table . row [ '<STR_LIT>' ] = str ( i ) <EOL> table . row [ '<STR_LIT>' ] = i % <NUM_LIT:2> <EOL> table . row [ '<STR_LIT>' ] = i <EOL> table . row [ '<STR_LIT>' ] = float ( nrows - i - <NUM_LIT:1> ) <EOL> table . row . append ( ) <EOL> table . flush ( ) <EOL> indexrows = table . cols . var1 . create_index ( ) <EOL> indexrows = table . cols . var2 . create_index ( ) <EOL> indexrows = table . cols . var3 . create_index ( ) <EOL> if common . verbose : <EOL> print ( "<STR_LIT>" , nrows ) <EOL> print ( "<STR_LIT>" , table . cols . var1 . index . nelements ) <EOL> print ( "<STR_LIT>" , indexrows ) <EOL> class RenameNodeTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( RenameNodeTestCase , self ) . setUp ( ) <EOL> h5file = self . h5file <EOL> root = h5file . root <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , title = "<STR_LIT>" ) <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> ] , "<STR_LIT>" ) <EOL> group = h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_group ( group , '<STR_LIT>' , "<STR_LIT>" ) <EOL> populateTable ( self . h5file . root , '<STR_LIT>' ) <EOL> def test00 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . rename_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup2 . _v_title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup3 . _v_title , "<STR_LIT>" ) <EOL> def test01 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . rename_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup . _v_title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup3 . _v_title , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> def test01b ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . rename_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . rename_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup . _v_title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup4 . _v_title , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> def test02 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . rename_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . anarray . title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . anarray2 . title , "<STR_LIT>" ) <EOL> def test03 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . rename_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> table = self . h5file . root . table <EOL> self . assertTrue ( table . cols . var1 . index is not None ) <EOL> self . assertTrue ( table . cols . var2 . index is not None ) <EOL> self . assertTrue ( table . cols . var3 . index is not None ) <EOL> self . assertTrue ( table . cols . var4 . index is None ) <EOL> self . assertEqual ( table . cols . var1 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var2 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var3 . index . nelements , minRowIndex ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . table . title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . table2 . title , "<STR_LIT>" ) <EOL> table = self . h5file . root . table2 <EOL> self . assertTrue ( table . cols . var1 . index is not None ) <EOL> self . assertTrue ( table . cols . var2 . index is not None ) <EOL> self . assertTrue ( table . cols . var3 . index is not None ) <EOL> self . assertEqual ( table . cols . var1 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var2 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var3 . index . nelements , minRowIndex ) <EOL> self . assertTrue ( table . cols . var4 . index is None ) <EOL> class MoveNodeTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( MoveNodeTestCase , self ) . setUp ( ) <EOL> h5file = self . h5file <EOL> root = h5file . root <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , title = "<STR_LIT>" ) <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> ] , "<STR_LIT>" ) <EOL> group = h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_group ( group , '<STR_LIT>' , "<STR_LIT>" ) <EOL> populateTable ( self . h5file . root , '<STR_LIT>' ) <EOL> def test00 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . move_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . anarray . title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup . agroup3 . anarray . title , <EOL> "<STR_LIT>" ) <EOL> def test01 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . move_node ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup . _v_title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup2 . agroup3 . _v_title , <EOL> "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> def test01b ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . move_node ( '<STR_LIT>' , '<STR_LIT:/>' , '<STR_LIT>' ) <EOL> self . h5file . move_node ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup . _v_title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup2 . agroup4 . _v_title , <EOL> "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> def test02 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . move_node ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . anarray . title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( <EOL> self . h5file . root . agroup2 . anarray2 . title , "<STR_LIT>" ) <EOL> def test03 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . move_node ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> table = self . h5file . root . table <EOL> self . assertTrue ( table . cols . var1 . index is not None ) <EOL> self . assertTrue ( table . cols . var2 . index is not None ) <EOL> self . assertTrue ( table . cols . var3 . index is not None ) <EOL> self . assertTrue ( table . cols . var4 . index is None ) <EOL> self . assertEqual ( table . cols . var1 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var2 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var3 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( self . h5file . root . table . title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup2 . table2 . title , "<STR_LIT>" ) <EOL> table = self . h5file . root . agroup2 . table2 <EOL> self . assertTrue ( table . cols . var1 . index is not None ) <EOL> self . assertTrue ( table . cols . var2 . index is not None ) <EOL> self . assertTrue ( table . cols . var3 . index is not None ) <EOL> self . assertEqual ( table . cols . var1 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var2 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var3 . index . nelements , minRowIndex ) <EOL> self . assertTrue ( table . cols . var4 . index is None ) <EOL> class RemoveNodeTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( RemoveNodeTestCase , self ) . setUp ( ) <EOL> h5file = self . h5file <EOL> root = h5file . root <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , title = "<STR_LIT>" ) <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> ] , "<STR_LIT>" ) <EOL> group = h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_group ( group , '<STR_LIT>' , "<STR_LIT>" ) <EOL> populateTable ( self . h5file . root , '<STR_LIT>' ) <EOL> def test00 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . anarray . title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test00b ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . anarray . title , "<STR_LIT>" ) <EOL> self . assertEqual ( <EOL> self . h5file . root . agroup . anarray2 . title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test00c ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> table = self . h5file . root . table <EOL> self . assertTrue ( table . cols . var1 . index is not None ) <EOL> self . assertTrue ( table . cols . var2 . index is not None ) <EOL> self . assertTrue ( table . cols . var3 . index is not None ) <EOL> self . assertTrue ( table . cols . var4 . index is None ) <EOL> self . assertEqual ( table . cols . var1 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var2 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var3 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( self . h5file . root . table . title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test01 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . remove_node ( '<STR_LIT>' , recursive = <NUM_LIT:1> ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup . _v_title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> def test01b ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . remove_node ( '<STR_LIT>' , recursive = <NUM_LIT:1> ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup . _v_title , "<STR_LIT>" ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> class CopyNodeTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( CopyNodeTestCase , self ) . setUp ( ) <EOL> h5file = self . h5file <EOL> root = h5file . root <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , title = "<STR_LIT>" ) <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> ] , "<STR_LIT>" ) <EOL> group = h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_group ( group , '<STR_LIT>' , "<STR_LIT>" ) <EOL> populateTable ( self . h5file . root , '<STR_LIT>' ) <EOL> def test00_copyLeaf ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> new_node = self . h5file . copy_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( self . h5file . root . agroup . agroup3 . anarray is new_node ) <EOL> def test00b_copyTable ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> warnings . filterwarnings ( "<STR_LIT:ignore>" , category = UserWarning ) <EOL> table = self . h5file . copy_node ( <EOL> '<STR_LIT>' , '<STR_LIT>' , propindexes = True ) <EOL> warnings . filterwarnings ( "<STR_LIT:default>" , category = UserWarning ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> table = self . h5file . root . agroup . agroup3 . table <EOL> self . assertEqual ( table . title , "<STR_LIT>" ) <EOL> self . assertTrue ( table . cols . var1 . index is not None ) <EOL> self . assertTrue ( table . cols . var2 . index is not None ) <EOL> self . assertTrue ( table . cols . var3 . index is not None ) <EOL> self . assertEqual ( table . cols . var1 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var2 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var3 . index . nelements , minRowIndex ) <EOL> self . assertTrue ( table . cols . var4 . index is None ) <EOL> self . h5file . undo ( ) <EOL> table = self . h5file . root . table <EOL> self . assertTrue ( table . cols . var1 . index is not None ) <EOL> self . assertTrue ( table . cols . var2 . index is not None ) <EOL> self . assertTrue ( table . cols . var3 . index is not None ) <EOL> self . assertTrue ( table . cols . var4 . index is None ) <EOL> self . assertEqual ( table . cols . var1 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var2 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var3 . index . nelements , minRowIndex ) <EOL> self . assertTrue ( "<STR_LIT>" not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> self . assertTrue ( "<STR_LIT>" in self . h5file ) <EOL> table = self . h5file . root . agroup . agroup3 . table <EOL> self . assertEqual ( table . title , "<STR_LIT>" ) <EOL> self . assertTrue ( table . cols . var1 . index is not None ) <EOL> self . assertTrue ( table . cols . var2 . index is not None ) <EOL> self . assertTrue ( table . cols . var3 . index is not None ) <EOL> self . assertEqual ( table . cols . var1 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var2 . index . nelements , minRowIndex ) <EOL> self . assertEqual ( table . cols . var3 . index . nelements , minRowIndex ) <EOL> self . assertTrue ( table . cols . var4 . index is None ) <EOL> def test01_copyGroup ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> new_node = self . h5file . copy_node ( <EOL> '<STR_LIT>' , newname = '<STR_LIT>' , recursive = True ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( self . h5file . root . acopy is new_node ) <EOL> def test02_copyLeafOverwrite ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> oldNode = self . h5file . root . agroup <EOL> new_node = self . h5file . copy_node ( <EOL> '<STR_LIT>' , newname = '<STR_LIT>' , overwrite = True ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( self . h5file . root . agroup is oldNode ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( self . h5file . root . agroup is new_node ) <EOL> def test03_copyChildren ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . copy_children ( '<STR_LIT>' , '<STR_LIT>' , recursive = True ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> class ComplexTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( ComplexTestCase , self ) . setUp ( ) <EOL> h5file = self . h5file <EOL> root = h5file . root <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] , title = "<STR_LIT>" ) <EOL> h5file . create_array ( root , '<STR_LIT>' , [ <NUM_LIT:1> ] , "<STR_LIT>" ) <EOL> group = h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_array ( group , '<STR_LIT>' , [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> h5file . create_group ( root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> h5file . create_group ( group , '<STR_LIT>' , "<STR_LIT>" ) <EOL> def test00 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_array ( self . h5file . root , '<STR_LIT>' , <EOL> [ <NUM_LIT:1> ] , "<STR_LIT>" ) <EOL> self . h5file . create_group ( self . h5file . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> new_node = self . h5file . copy_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> new_node = self . h5file . copy_children ( <EOL> '<STR_LIT>' , '<STR_LIT>' , recursive = <NUM_LIT:1> ) <EOL> self . h5file . rename_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> new_node = self . h5file . copy_node ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( self . h5file . root . agroup . anarray3 is new_node ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> def test01 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . create_array ( self . h5file . root , '<STR_LIT>' , <EOL> [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . create_array ( self . h5file . root , '<STR_LIT>' , <EOL> [ <NUM_LIT:3> ] , "<STR_LIT>" ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . create_array ( self . h5file . root , '<STR_LIT>' , <EOL> [ <NUM_LIT:4> ] , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertEqual ( self . h5file . root . anarray . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . anarray [ : ] , [ <NUM_LIT:1> ] ) <EOL> self . h5file . redo ( ) <EOL> self . assertEqual ( self . h5file . root . anarray . title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . anarray [ : ] , [ <NUM_LIT:4> ] ) <EOL> def test02 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . create_group ( self . h5file . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . create_group ( self . h5file . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . create_group ( self . h5file . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . create_group ( self . h5file . root . agroup2 , '<STR_LIT>' , <EOL> "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertEqual ( self . h5file . root . agroup2 . _v_title , "<STR_LIT>" ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertEqual ( self . h5file . root . agroup2 . _v_title , "<STR_LIT>" ) <EOL> self . assertEqual ( self . h5file . root . agroup2 . agroup5 . _v_title , <EOL> "<STR_LIT>" ) <EOL> def test03 ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . remove_node ( '<STR_LIT>' , recursive = <NUM_LIT:1> ) <EOL> self . h5file . create_group ( self . h5file . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . create_group ( self . h5file . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> self . h5file . create_group ( self . h5file . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . create_group ( self . h5file . root . agroup , '<STR_LIT>' , <EOL> "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup . _v_title , "<STR_LIT>" ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertEqual ( self . h5file . root . agroup . _v_title , "<STR_LIT>" ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertEqual ( <EOL> self . h5file . root . agroup . agroup5 . _v_title , "<STR_LIT>" ) <EOL> def test03b ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> self . h5file . enable_undo ( ) <EOL> self . h5file . create_group ( self . h5file . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . create_group ( self . h5file . root . agroup3 , '<STR_LIT>' , <EOL> "<STR_LIT>" ) <EOL> self . h5file . remove_node ( '<STR_LIT>' , recursive = <NUM_LIT:1> ) <EOL> self . h5file . create_group ( self . h5file . root , '<STR_LIT>' , "<STR_LIT>" ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . h5file . redo ( ) <EOL> self . assertEqual ( self . h5file . root . agroup3 . _v_title , "<STR_LIT>" ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> class AttributesTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( AttributesTestCase , self ) . setUp ( ) <EOL> array = self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> ] ) <EOL> attrs = array . attrs <EOL> attrs . attr_1 = <NUM_LIT:10> <EOL> attrs . attr_2 = <NUM_LIT:20> <EOL> attrs . attr_3 = <NUM_LIT:30> <EOL> def test00_setAttr ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> array = self . h5file . root . array <EOL> attrs = array . attrs <EOL> self . h5file . enable_undo ( ) <EOL> setattr ( attrs , '<STR_LIT>' , <NUM_LIT:0> ) <EOL> self . assertTrue ( '<STR_LIT>' in attrs ) <EOL> self . assertEqual ( attrs . attr_0 , <NUM_LIT:0> ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in attrs ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in attrs ) <EOL> self . assertEqual ( attrs . attr_0 , <NUM_LIT:0> ) <EOL> def test01_setAttrExisting ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> array = self . h5file . root . array <EOL> attrs = array . attrs <EOL> self . h5file . enable_undo ( ) <EOL> setattr ( attrs , '<STR_LIT>' , <NUM_LIT:11> ) <EOL> self . assertTrue ( '<STR_LIT>' in attrs ) <EOL> self . assertEqual ( attrs . attr_1 , <NUM_LIT:11> ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in attrs ) <EOL> self . assertEqual ( attrs . attr_1 , <NUM_LIT:10> ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in attrs ) <EOL> self . assertEqual ( attrs . attr_1 , <NUM_LIT:11> ) <EOL> def test02_delAttr ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> array = self . h5file . root . array <EOL> attrs = array . attrs <EOL> self . h5file . enable_undo ( ) <EOL> delattr ( attrs , '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT>' not in attrs ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in attrs ) <EOL> self . assertEqual ( attrs . attr_1 , <NUM_LIT:10> ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in attrs ) <EOL> def test03_copyNodeAttrs ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % <EOL> self . __class__ . __name__ ) <EOL> rattrs = self . h5file . root . _v_attrs <EOL> rattrs . attr_0 = <NUM_LIT:0> <EOL> rattrs . attr_1 = <NUM_LIT:100> <EOL> array = self . h5file . root . array <EOL> attrs = array . attrs <EOL> self . h5file . enable_undo ( ) <EOL> attrs . _f_copy ( self . h5file . root ) <EOL> self . assertEqual ( rattrs . attr_0 , <NUM_LIT:0> ) <EOL> self . assertEqual ( rattrs . attr_1 , <NUM_LIT:10> ) <EOL> self . assertEqual ( rattrs . attr_2 , <NUM_LIT:20> ) <EOL> self . assertEqual ( rattrs . attr_3 , <NUM_LIT:30> ) <EOL> self . h5file . undo ( ) <EOL> self . assertEqual ( rattrs . attr_0 , <NUM_LIT:0> ) <EOL> self . assertEqual ( rattrs . attr_1 , <NUM_LIT:100> ) <EOL> self . assertTrue ( '<STR_LIT>' not in rattrs ) <EOL> self . assertTrue ( '<STR_LIT>' not in rattrs ) <EOL> self . h5file . redo ( ) <EOL> self . assertEqual ( rattrs . attr_0 , <NUM_LIT:0> ) <EOL> self . assertEqual ( rattrs . attr_1 , <NUM_LIT:10> ) <EOL> self . assertEqual ( rattrs . attr_2 , <NUM_LIT:20> ) <EOL> self . assertEqual ( rattrs . attr_3 , <NUM_LIT:30> ) <EOL> def test04_replaceNode ( self ) : <EOL> """<STR_LIT>""" <EOL> if common . verbose : <EOL> print ( '<STR_LIT:\n>' , '<STR_LIT>' * <NUM_LIT:30> ) <EOL> print ( "<STR_LIT>" % self . __class__ . __name__ ) <EOL> array = self . h5file . root . array <EOL> attrs = array . attrs <EOL> self . h5file . enable_undo ( ) <EOL> attrs . attr_1 = <NUM_LIT:11> <EOL> self . h5file . remove_node ( '<STR_LIT>' ) <EOL> arr = self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> arr . attrs . attr_1 = <NUM_LIT:12> <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file . root . array . attrs ) <EOL> self . assertEqual ( self . h5file . root . array . attrs . attr_1 , <NUM_LIT:10> ) <EOL> self . h5file . redo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file . root . array . attrs ) <EOL> self . assertEqual ( self . h5file . root . array . attrs . attr_1 , <NUM_LIT:12> ) <EOL> class NotLoggedTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> class NotLoggedArray ( NotLoggedMixin , tables . Array ) : <EOL> pass <EOL> def test00_hierarchy ( self ) : <EOL> """<STR_LIT>""" <EOL> self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' ) <EOL> self . h5file . enable_undo ( ) <EOL> arr = self . NotLoggedArray ( self . h5file . root , '<STR_LIT:test>' , <EOL> [ <NUM_LIT:1> ] , self . _getMethodName ( ) ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> arr . move ( '<STR_LIT>' ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> arr . remove ( ) <EOL> self . h5file . undo ( ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> def test01_attributes ( self ) : <EOL> """<STR_LIT>""" <EOL> arr = self . NotLoggedArray ( self . h5file . root , '<STR_LIT:test>' , <EOL> [ <NUM_LIT:1> ] , self . _getMethodName ( ) ) <EOL> self . h5file . enable_undo ( ) <EOL> arr . _v_attrs . foo = '<STR_LIT:bar>' <EOL> self . h5file . undo ( ) <EOL> self . assertEqual ( arr . _v_attrs . foo , '<STR_LIT:bar>' ) <EOL> arr . _v_attrs . foo = '<STR_LIT>' <EOL> self . h5file . undo ( ) <EOL> self . assertEqual ( arr . _v_attrs . foo , '<STR_LIT>' ) <EOL> del arr . _v_attrs . foo <EOL> self . h5file . undo ( ) <EOL> self . assertRaises ( AttributeError , getattr , arr . _v_attrs , '<STR_LIT:foo>' ) <EOL> class CreateParentsTestCase ( common . TempFileMixin , TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( CreateParentsTestCase , self ) . setUp ( ) <EOL> g1 = self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' ) <EOL> self . h5file . create_group ( g1 , '<STR_LIT>' ) <EOL> def existing ( self , paths ) : <EOL> """<STR_LIT>""" <EOL> return frozenset ( path for path in paths if path in self . h5file ) <EOL> def basetest ( self , doit , pre , post ) : <EOL> pre ( ) <EOL> self . h5file . enable_undo ( ) <EOL> paths = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> for newpath in paths : <EOL> before = self . existing ( paths ) <EOL> doit ( newpath ) <EOL> after = self . existing ( paths ) <EOL> self . assertTrue ( after . issuperset ( before ) ) <EOL> self . h5file . undo ( ) <EOL> post ( newpath ) <EOL> after = self . existing ( paths ) <EOL> self . assertEqual ( after , before ) <EOL> def test00_create ( self ) : <EOL> """<STR_LIT>""" <EOL> def pre ( ) : <EOL> pass <EOL> def doit ( newpath ) : <EOL> self . h5file . create_array ( newpath , '<STR_LIT>' , [ <NUM_LIT:1> ] , createparents = True ) <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) in self . h5file ) <EOL> def post ( newpath ) : <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) not in self . h5file ) <EOL> self . basetest ( doit , pre , post ) <EOL> def test01_move ( self ) : <EOL> """<STR_LIT>""" <EOL> def pre ( ) : <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> def doit ( newpath ) : <EOL> self . h5file . move_node ( '<STR_LIT>' , newpath , createparents = True ) <EOL> self . assertTrue ( '<STR_LIT>' not in self . h5file ) <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) in self . h5file ) <EOL> def post ( newpath ) : <EOL> self . assertTrue ( '<STR_LIT>' in self . h5file ) <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) not in self . h5file ) <EOL> self . basetest ( doit , pre , post ) <EOL> def test02_copy ( self ) : <EOL> """<STR_LIT>""" <EOL> def pre ( ) : <EOL> self . h5file . create_array ( '<STR_LIT:/>' , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> def doit ( newpath ) : <EOL> self . h5file . copy_node ( '<STR_LIT>' , newpath , createparents = True ) <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) in self . h5file ) <EOL> def post ( newpath ) : <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) not in self . h5file ) <EOL> self . basetest ( doit , pre , post ) <EOL> def test03_copyChildren ( self ) : <EOL> """<STR_LIT>""" <EOL> def pre ( ) : <EOL> g = self . h5file . create_group ( '<STR_LIT:/>' , '<STR_LIT>' ) <EOL> self . h5file . create_array ( g , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> self . h5file . create_array ( g , '<STR_LIT>' , [ <NUM_LIT:1> ] ) <EOL> def doit ( newpath ) : <EOL> self . h5file . copy_children ( '<STR_LIT>' , newpath , createparents = True ) <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) in self . h5file ) <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) in self . h5file ) <EOL> def post ( newpath ) : <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) not in self . h5file ) <EOL> self . assertTrue ( join_path ( newpath , '<STR_LIT>' ) not in self . h5file ) <EOL> self . basetest ( doit , pre , post ) <EOL> def suite ( ) : <EOL> theSuite = unittest . TestSuite ( ) <EOL> niter = <NUM_LIT:1> <EOL> for n in range ( niter ) : <EOL> theSuite . addTest ( unittest . makeSuite ( BasicTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( PersistenceTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( CreateArrayTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( CreateGroupTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( RenameNodeTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( MoveNodeTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( RemoveNodeTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( CopyNodeTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( AttributesTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( ComplexTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( NotLoggedTestCase ) ) <EOL> theSuite . addTest ( unittest . makeSuite ( CreateParentsTestCase ) ) <EOL> if common . heavy : <EOL> pass <EOL> return theSuite <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import sys <EOL> common . parse_argv ( sys . argv ) <EOL> common . print_versions ( ) <EOL> unittest . main ( defaultTest = '<STR_LIT>' ) </s>
