Beispiel #1
0
 def test_can_process(self):
     node = StartHandler('nodeTest', self.stateMngr, self.pageMngr)
     iq = self.iq
     cmd = Command(node='nodeTest', action='next')
     cmd_el = cmd.toElement()
     del cmd_el['sessionid']
     iq.addChild(cmd_el)
     self.assertTrue(node.can_process(iq))
Beispiel #2
0
    def test_make_next_iq(self):
        self.pageMngr.next_page = Mock(side_effect=utils.good_side_effect(iq()))
        node = StartHandler('nodeTest', self.stateMngr, self.pageMngr)
        iq1 = self.iq
        d_iq2 = node._make_next_iq(iq1, None)

        def checkIt(iq2):
            self.assertTrue(self.pageMngr.next_page.called)
            self.assertEquals(iq2.toXml(), iq().toXml())

        d_iq2.addCallback(checkIt)
        return d_iq2
Beispiel #3
0
 def test_manage_state(self):
     node = StartHandler('nodeTest', self.stateMngr, self.pageMngr)
     s = node._manage_state(None)
     self.assertEquals(s, dict())
Beispiel #4
0
 def test_parse_iq(self):
     node = StartHandler('nodeTest', self.stateMngr, self.pageMngr)
     s = node._parse_iq(self.iq)
     self.assertEquals(s, dict())
Beispiel #5
0
 def test_can_process_wrongNode(self):
     node = StartHandler('nodeTest', self.stateMngr, self.pageMngr)
     iq = self.iq
     cmd = Command(node='wrongNode', action='cancel')
     iq.addChild(cmd.toElement())
     self.assertFalse(node.can_process(iq))
Beispiel #6
0
 def test_can_process_hasSessionId(self):
     node = StartHandler('nodeTest', self.stateMngr, self.pageMngr)
     iq = self.iq
     cmd = Command(node='nodeTest', action='prev')
     iq.addChild(cmd.toElement())
     self.assertFalse(node.can_process(iq))
Beispiel #7
0
 def test_can_process_nocmd(self):
     node = StartHandler('nodeTest', self.stateMngr, self.pageMngr)
     self.assertFalse(node.can_process(self.iq))