示例#1
0
 def test_deleteNode(self):
     writer = SofiePyTableAccess('simple-test-data.h5', '/test')
     self.assertEqual(writer.getRunName(), '/test')
     writer.setRunName('goat')
     self.assertEqual(writer.getRunName(), '/goat')
     self.assertEqual(writer.getRuns('goat'), [])
     writer.setRunName('goat1', False)
     self.assertEqual(writer.getRuns('goat1'), [])
     self.assertEqual(writer.getRunName(), '/')
示例#2
0
 def test_deleteRun(self):
     writer = SofiePyTableAccess('simple-test-data.h5', '/test')
     self.assertEqual(writer.getRunName(), '/test')
     self.assertEqual(writer.getRuns('/'), ['/RunMeta'])
     self.assertFalse(writer.deleteRun('goat'))
     self.assertFalse(writer.deleteRun('test'))
     self.assertEqual(writer.getRuns('/'), ['/RunMeta'])
     self.assertFalse(writer.deleteRun('test', recursive=True))
     self.assertEqual(writer.getRuns('/'), ['/RunMeta'])
     writer.setRunName('/again', True)
     self.assertEqual(writer.getRuns('/'), ['/RunMeta'])
     self.assertFalse(writer.deleteRun('/again/', recursive=True))