Example #1
0
    def testUserDialog_05(self):
        from livejournal.ljconfig import LJConfig
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import UserDialogController

        dlg = ComboBoxDialog(self.application.mainWindow,
                             "",
                             "",
                             wx.CB_DROPDOWN | wx.CB_SORT)

        # dlg.SetModalResult (wx.ID_OK)
        Tester.dialogTester.appendOk()
        controller = UserDialogController(dlg, self.application, "jenyay")
        controller.showDialog()

        Tester.dialogTester.appendOk()
        controller2 = UserDialogController(dlg, self.application, "jenyay_test")
        controller2.showDialog()

        Tester.dialogTester.appendOk()
        controller3 = UserDialogController(dlg, self.application, "jenyay")
        controller3.showDialog()

        self.assertEqual(LJConfig(self.application.config).users.value, [
                         "jenyay", "jenyay_test"])
        self.assertEqual(LJConfig(self.application.config).communities.value, [""])
Example #2
0
    def testUserDialog_07 (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"jenyay")
        controller.showDialog()

        controller2 = UserDialogController (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 = UserDialogController (dlg2, Application, u"jenyay")
        controller3.showDialog()

        self.assertEqual (dlg2.GetStrings(), [u"jenyay", u"jenyay_test"])
Example #3
0
    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)
Example #4
0
    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)
Example #5
0
    def testUserDialog_02(self):
        from livejournal.ljconfig import LJConfig
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import UserDialogController

        dlg = ComboBoxDialog(self.application.mainWindow, "", "",
                             wx.CB_DROPDOWN | wx.CB_SORT)

        # dlg.SetModalResult (wx.ID_OK)
        Tester.dialogTester.appendOk()

        controller = UserDialogController(dlg, self.application, "jenyay")
        controller.showDialog()

        valid_result = "(:ljuser jenyay:)"

        self.assertEqual(controller.result, valid_result)
        self.assertEqual(
            LJConfig(self.application.config).users.value, ["jenyay"])
Example #6
0
    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"])
Example #7
0
    def testUserDialog_02(self):
        from livejournal.ljconfig import LJConfig
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import UserDialogController

        dlg = ComboBoxDialog(self.application.mainWindow,
                             "",
                             "",
                             wx.CB_DROPDOWN | wx.CB_SORT)

        # dlg.SetModalResult (wx.ID_OK)
        Tester.dialogTester.appendOk()

        controller = UserDialogController(dlg, self.application, "jenyay")
        controller.showDialog()

        valid_result = "(:ljuser jenyay:)"

        self.assertEqual(controller.result, valid_result)
        self.assertEqual(LJConfig(self.application.config).users.value, ["jenyay"])
Example #8
0
    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"])
Example #9
0
    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"])
Example #10
0
    def testUserDialog_04(self):
        from livejournal.ljconfig import LJConfig
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import UserDialogController

        dlg = ComboBoxDialog(self.application.mainWindow,
                             "",
                             "",
                             wx.CB_DROPDOWN | wx.CB_SORT)

        # dlg.SetModalResult (wx.ID_OK)
        Tester.dialogTester.appendOk()

        controller = UserDialogController(dlg, self.application, "jenyay")
        controller.showDialog()

        Tester.dialogTester.appendOk()
        controller2 = UserDialogController(dlg, self.application, "jenyay_test")
        controller2.showDialog()

        self.assertEqual(LJConfig(self.application.config).users.value, [
                         "jenyay", "jenyay_test"])
        self.assertEqual(LJConfig(self.application.config).communities.value, [""])
Example #11
0
    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"])
Example #12
0
    def testUserDialog_07(self):
        from livejournal.comboboxdialog import ComboBoxDialog
        from livejournal.dialogcontroller import UserDialogController

        dlg = ComboBoxDialog(self.application.mainWindow,
                             "",
                             "",
                             wx.CB_DROPDOWN | wx.CB_SORT)

        # dlg.SetModalResult (wx.ID_OK)
        Tester.dialogTester.appendOk()
        controller = UserDialogController(dlg, self.application, "jenyay")
        controller.showDialog()

        Tester.dialogTester.appendOk()
        controller2 = UserDialogController(dlg, self.application, "jenyay_test")
        controller2.showDialog()

        dlg2 = ComboBoxDialog(self.application.mainWindow,
                              "",
                              "",
                              wx.CB_DROPDOWN | wx.CB_SORT)

        # dlg2.SetModalResult (wx.ID_OK)
        Tester.dialogTester.appendOk()
        controller3 = UserDialogController(dlg2, self.application, "jenyay")
        controller3.showDialog()

        self.assertEqual(dlg2.GetStrings(), ["jenyay", "jenyay_test"])