Exemplo n.º 1
0
    def _getClickParams(self,
                        href,
                        button,
                        modifier,
                        isurl,
                        ispage,
                        isfilename,
                        isanchor):
        linktype = None

        if isanchor:
            linktype = u"anchor"

        if isurl:
            linktype = u"url"
        elif ispage:
            linktype = u"page"
        elif isfilename:
            linktype = u"filename"

        return LinkClickParams(
            link=href,
            button=button,
            modifier=modifier,
            linktype=linktype,
        )
    def testOnLinkClick_05(self):
        params = LinkClickParams('exec://exec/?title=qqq')

        Tester.dialogTester.appendOk()
        self.assertEqual(Tester.dialogTester.count, 1)

        self._controller.onLinkClick(None, params)
        self.assertEqual(Tester.dialogTester.count, 0)
        self.assertTrue(params.process)
    def testOnLinkClick_04(self):
        params = LinkClickParams('exec://exec/')

        Tester.dialogTester.appendOk()
        self.assertEqual(Tester.dialogTester.count, 1)

        self._controller.onLinkClick(None, params)
        self.assertEqual(Tester.dialogTester.count, 1)
        self.assertFalse(params.process)
    def testOnLinkClick_03(self):
        params = LinkClickParams('exec://other/?com1=sometools')

        Tester.dialogTester.appendOk()
        self.assertEqual(Tester.dialogTester.count, 1)

        self._controller.onLinkClick(None, params)
        self.assertEqual(Tester.dialogTester.count, 1)
        self.assertFalse(params.process)
    def testOnLinkClick_01 (self):
        params = LinkClickParams (u'exec://exec/?com1=sometools')

        Tester.dialogTester.appendOk()
        self.assertEqual (Tester.dialogTester.count, 1)

        self._controller.onLinkClick (None, params)
        self.assertEqual (Tester.dialogTester.count, 0)
        self.assertTrue (params.process)
    def testWarning_02(self):
        from externaltools.config import ExternalToolsConfig
        config = ExternalToolsConfig(Application.config)
        config.execWarning = False

        params = LinkClickParams('exec://exec/?com1=sometools')

        Tester.dialogTester.appendOk()
        self.assertEqual(Tester.dialogTester.count, 1)

        self._controller.onLinkClick(None, params)
        self.assertEqual(Tester.dialogTester.count, 1)
        self.assertTrue(params.process)