def testHeaderLabelPaintEvent(self): widget = DataPanel() data = numpy.array([1, 2, 3, 4, 5]) widget.setData(data) # Expected to execute HeaderLabel.paintEvent widget.setVisible(True) self.qWaitForWindowExposed(widget)
def testHeaderLabelPaintEvent(self): widget = DataPanel() data = numpy.array([1, 2, 3, 4, 5]) widget.setData(data) # Expected to execute HeaderLabel.paintEvent widget.setVisible(True) self.qWaitForWindowExposed(widget)
def testRemoveDatasetsFrom(self): f = h5py.File(os.path.join(_tmpDirectory, "data.h5")) try: widget = DataPanel() widget.setData(f["arrays/scalar"]) widget.removeDatasetsFrom(f) self.assertIs(widget.getData(), None) finally: widget.setData(None) f.close()
def testRemoveDatasetsFrom(self): f = h5py.File(self.data_h5, mode='r') try: widget = DataPanel() widget.setData(f["arrays/scalar"]) widget.removeDatasetsFrom(f) self.assertIs(widget.getData(), None) finally: widget.setData(None) f.close()
def testRemoveDatasetsFrom(self): f = h5py.File(os.path.join(_tmpDirectory, "data.h5")) try: widget = DataPanel() widget.setData(f["arrays/scalar"]) widget.removeDatasetsFrom(f) self.assertIs(widget.getData(), None) finally: widget.setData(None) f.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(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 testDataNone(self): widget = DataPanel() widget.setData(None) self.assertIs(widget.getData(), None) self.assertIs(widget.getCustomNxdataItem(), None)
def testData(self): widget = DataPanel() data = numpy.array([1, 2, 3, 4, 5]) widget.setData(data) self.assertIs(widget.getData(), data) self.assertIs(widget.getCustomNxdataItem(), None)
def testDataNone(self): widget = DataPanel() widget.setData(None) self.assertIs(widget.getData(), None) self.assertIs(widget.getCustomNxdataItem(), None)
def testData(self): widget = DataPanel() data = numpy.array([1, 2, 3, 4, 5]) widget.setData(data) self.assertIs(widget.getData(), data) self.assertIs(widget.getCustomNxdataItem(), None)