def test_remove(self): a = Actions() a.add('prev') a.add('next') a.remove('prev') self.assertEquals(len(a.actions), 1) self.assertTrue('next' in a.actions)
def makeCommand(subs): [log.msg(a) for a in subs] c = makeExecutingCommand(iq) a = Actions() a.setDefault("complete") a.add("prev") c.set_actions(a) form = data_form.Form( formType="form", title=u"Configure channel", instructions=[u"Set all output for %s" % psnode], formNamespace=collab.COLLAB_NS, ) form.addField( data_form.Field( var="subscribers", label=u"Subscribers", desc=u"Please choose who receives the output from %s" % psnode, required=True, fieldType="list-multi", options=self._getOptions(subs, pubs, admins), ) ) c.set_form(form) return c.toElement()
def makeCommand(admins): c = makeExecutingCommand(iq) a = Actions() a.setDefault("next") a.add("prev") a.add("complete") c.set_actions(a) form = data_form.Form( formType="form", title=u"Configure channel", instructions=[u"Set all owners for %s" % psnode], formNamespace=collab.COLLAB_NS, ) form.addField( data_form.Field( var="admins", label=u"Administrators", desc=u"Please choose the owners for %s" % psnode, required=True, fieldType="list-multi", options=self._getOptions(admins), ) ) c.set_form(form) return c.toElement()
def test_toElement(self): a = Actions() a.setDefault('next') a.add('prev') el = Element((None, 'actions')) el['execute'] = 'next' el.addElement('prev') el.addElement('next') self.assertEquals(a.toElement().toXml(), el.toXml())
def makeCommand(components): c = makeExecutingCommand(iq) a = Actions() a.setDefault("next") a.add("complete") c.set_actions(a) form = data_form.Form( formType="form", title=u"Create a communications channel", instructions=[ u"Please select a Collab component to associate with the channel", u"and a suggested name for the channel", ], formNamespace=collab.COLLAB_NS, ) form.addField( data_form.Field( var="component", label=u"Collab component type", desc=u"Please choose the type of Collab component to associate", required=True, fieldType="list-single", options=[data_form.Option(o) for o in components], ) ) form.addField( data_form.Field( var="name", label=u"Suggested name", desc=u"Please suggest a name for the channel", required=True, fieldType="text-single", ) ) c.set_form(form) return c.toElement()
def test_remove_not_there(self): a = Actions() a.add('next') a.remove('wrong') self.assertEquals(len(a.actions), 1) self.assertTrue('next' in a.actions)
def test_add(self): a = Actions() a.add('next') self.assertEquals(len(a.actions), 1) self.assertTrue('next' in a.actions)