def testStepStatus(self): from mapclientplugins.imagesourcestep.widgets.configuredialog import ConfigureDialogState state = ConfigureDialogState() self.assertEqual(state.location(), '') newstate = ConfigureDialogState('here', 'there', 'anywhere', 3) self.assertEqual(newstate.identifier(), 'here') self.assertEqual(newstate.location(), 'there') self.assertEqual(newstate.pmrLocation(), 'anywhere') self.assertEqual(newstate.imageType(), 3) otherstate = ConfigureDialogState('here2', '', 'anywhere', 3) self.assertEqual(otherstate.identifier(), 'here2') self.assertEqual(otherstate.location(), '') self.assertEqual(otherstate.pmrLocation(), 'anywhere')
def __init__(self, location): super(ImageSourceStep, self).__init__('Image Source', location) self._icon = QtGui.QImage(':/imagesource/icons/landscapeimages.png') self.addPort(('http://physiomeproject.org/workflow/1.0/rdf-schema#port', 'http://physiomeproject.org/workflow/1.0/rdf-schema#provides', 'http://physiomeproject.org/workflow/1.0/rdf-schema#images')) self._configured = False self._category = 'Source' self._state = ConfigureDialogState()
def testConfigureDialog(self): if self.pixmap_unavailable: return from mapclientplugins.imagesourcestep.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') QTest.keyClicks(d._ui.localLineEdit, 'here') 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') self.assertEqual(newstate.location(), 'here')