コード例 #1
0
ファイル: test_livejournal.py プロジェクト: sarutobi/outwiker
    def testCommDialog_07(self):
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import CommunityDialogController

        dlg = ComboBoxDialog(Application.mainWindow, u"", u"",
                             wx.CB_DROPDOWN | wx.CB_SORT)

        dlg.SetModalResult(wx.ID_OK)

        controller = CommunityDialogController(dlg, Application, u"jenyay")
        controller.showDialog()

        controller2 = CommunityDialogController(dlg, Application,
                                                u"jenyay_test")
        controller2.showDialog()

        dlg2 = ComboBoxDialog(Application.mainWindow, u"", u"",
                              wx.CB_DROPDOWN | wx.CB_SORT)

        dlg2.SetModalResult(wx.ID_OK)

        controller3 = CommunityDialogController(dlg2, Application, u"jenyay")
        controller3.showDialog()

        self.assertEqual(dlg2.GetStrings(), [u"jenyay", u"jenyay_test"])
コード例 #2
0
ファイル: test_livejournal.py プロジェクト: sarutobi/outwiker
    def testUserDialog_01(self):
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import UserDialogController

        dlg = ComboBoxDialog(Application.mainWindow, u"", u"",
                             wx.CB_DROPDOWN | wx.CB_SORT)

        dlg.SetModalResult(wx.ID_OK)

        controller = UserDialogController(dlg, Application, u"")
        controller.showDialog()

        valid_result = u"(:ljuser :)"

        self.assertEqual(controller.result, valid_result)
コード例 #3
0
ファイル: test_livejournal.py プロジェクト: sarutobi/outwiker
    def testUserDialog_03(self):
        from livejournal.ljconfig import LJConfig
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import UserDialogController

        dlg = ComboBoxDialog(Application.mainWindow, u"", u"",
                             wx.CB_DROPDOWN | wx.CB_SORT)
        dlg.SetModalResult(wx.ID_OK)

        controller = UserDialogController(dlg, Application, u"jenyay")
        controller.showDialog()

        controller2 = UserDialogController(dlg, Application, u"jenyay")
        controller2.showDialog()

        self.assertEqual(LJConfig(Application.config).users.value, [u"jenyay"])
コード例 #4
0
ファイル: test_livejournal.py プロジェクト: sarutobi/outwiker
    def testCommDialog_02(self):
        from livejournal.ljconfig import LJConfig
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import CommunityDialogController

        dlg = ComboBoxDialog(Application.mainWindow, u"", u"",
                             wx.CB_DROPDOWN | wx.CB_SORT)

        dlg.SetModalResult(wx.ID_OK)

        controller = CommunityDialogController(dlg, Application, u"jenyay")
        controller.showDialog()

        valid_result = u"(:ljcomm jenyay:)"

        self.assertEqual(controller.result, valid_result)
        self.assertEqual(
            LJConfig(Application.config).communities.value, [u"jenyay"])
        self.assertEqual(LJConfig(Application.config).users.value, [u""])
コード例 #5
0
ファイル: test_livejournal.py プロジェクト: sarutobi/outwiker
    def testUserDialog_06(self):
        from livejournal.ljconfig import LJConfig
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import UserDialogController

        dlg = ComboBoxDialog(Application.mainWindow, u"", u"",
                             wx.CB_DROPDOWN | wx.CB_SORT)

        dlg.SetModalResult(wx.ID_OK)

        LJConfig(Application.config).users.value = [u"jenyay", u"jenyay_test"]

        controller = UserDialogController(dlg, Application, u"")
        controller.showDialog()

        valid_result = u"(:ljuser :)"

        self.assertEqual(controller.result, valid_result)
        self.assertEqual(dlg.GetStrings(), [u"jenyay", u"jenyay_test"])