def testReplaceDatasetsFrom(self): f = h5py.File(self.data_h5, mode='r') f2 = h5py.File(self.data2_h5, mode='r') try: widget = DataPanel() widget.setData(f["arrays/scalar"]) self.assertEqual(widget.getData()[()], 10) widget.replaceDatasetsFrom(f, f2) self.assertEqual(widget.getData()[()], 20) finally: widget.setData(None) f.close() f2.close()
def testReplaceDatasetsFrom(self): f = h5py.File(os.path.join(_tmpDirectory, "data.h5")) f2 = h5py.File(os.path.join(_tmpDirectory, "data2.h5")) try: widget = DataPanel() widget.setData(f["arrays/scalar"]) self.assertEqual(widget.getData()[()], 10) widget.replaceDatasetsFrom(f, f2) self.assertEqual(widget.getData()[()], 20) finally: widget.setData(None) f.close() f2.close()
def testReplaceDatasetsFrom(self): f = h5py.File(os.path.join(_tmpDirectory, "data.h5")) f2 = h5py.File(os.path.join(_tmpDirectory, "data2.h5")) try: widget = DataPanel() widget.setData(f["arrays/scalar"]) self.assertEqual(widget.getData()[()], 10) widget.replaceDatasetsFrom(f, f2) self.assertEqual(widget.getData()[()], 20) finally: widget.setData(None) f.close() f2.close()