Checking initial mark.
(self)
| 663 | self.assertEqual(self.h5file.root.otherarray4.read(), [6, 7]) |
| 664 | |
| 665 | def test08_initialmark(self): |
| 666 | """Checking initial mark.""" |
| 667 | |
| 668 | if common.verbose: |
| 669 | print("\n", "-=" * 30) |
| 670 | print("Running %s.test08_initialmark..." % self.__class__.__name__) |
| 671 | |
| 672 | # open the do/undo |
| 673 | self.h5file.enable_undo() |
| 674 | initmid = self.h5file.get_current_mark() |
| 675 | |
| 676 | # Create a new array |
| 677 | self.h5file.create_array("/", "otherarray", [3, 4], "Another array") |
| 678 | self.h5file.mark() |
| 679 | self._do_reopen() |
| 680 | self.h5file.create_array("/", "otherarray2", [4, 5], "Another array 2") |
| 681 | |
| 682 | # Now undo the past operations |
| 683 | self.h5file.undo(initmid) |
| 684 | self.assertNotIn("/otherarray", self.h5file) |
| 685 | self.assertNotIn("/otherarray2", self.h5file) |
| 686 | |
| 687 | # Redo all the operations |
| 688 | self.h5file.redo(-1) |
| 689 | self._do_reopen() |
| 690 | |
| 691 | # Check that objects has come back to life in a sane state |
| 692 | self.assertIn("/otherarray", self.h5file) |
| 693 | self.assertIn("/otherarray2", self.h5file) |
| 694 | self.assertEqual(self.h5file.root.otherarray.read(), [3, 4]) |
| 695 | self.assertEqual(self.h5file.root.otherarray2.read(), [4, 5]) |
| 696 | self.assertEqual(self.h5file.root.otherarray.title, "Another array") |
| 697 | self.assertEqual(self.h5file.root.otherarray2.title, "Another array 2") |
| 698 | |
| 699 | def test09_marknames(self): |
| 700 | """Checking mark names (wrong direction)""" |
nothing calls this directly
no test coverage detected