def testStepStatus(self): from mapclientplugins.pointcloudserializerstep.widgets.configuredialog import ConfigureDialogState state = ConfigureDialogState() self.assertEqual(state.identifier(), '') newstate = ConfigureDialogState('here') self.assertEqual(newstate.identifier(), 'here')
def __init__(self, location): super(PointCloudSerializerStep, self).__init__('Point Cloud Serializer', location) # self._name = 'Point Cloud Store' # self._location = location self._icon = QtGui.QImage(':/pointcloudserializer/images/pointcloudserializer.png') self.addPort(('http://physiomeproject.org/workflow/1.0/rdf-schema#port', 'http://physiomeproject.org/workflow/1.0/rdf-schema#uses', 'http://physiomeproject.org/workflow/1.0/rdf-schema#pointcloud')) self._state = ConfigureDialogState() self._category = 'Sink' self._dataIn = None
def testConfigureDialog(self): if self.pixmap_unavailable: return from mapclientplugins.pointcloudserializerstep.widgets.configuredialog import ConfigureDialog, ConfigureDialogState state = ConfigureDialogState() d = ConfigureDialog(state) self.assertEqual( d._ui.buttonBox.button(QtGui.QDialogButtonBox.Ok).isEnabled(), False) QTest.keyClicks(d._ui.identifierLineEdit, 'hello') self.assertEqual( d._ui.buttonBox.button(QtGui.QDialogButtonBox.Ok).isEnabled(), True) # QTest.mouseClick(d._ui.buttonBox.button(QtGui.QDialogButtonBox.Ok), QtCore.Qt.LeftButton) newstate = d.getState() self.assertEqual(newstate.identifier(), 'hello')