def testCommDialog_05(self): from livejournal.ljconfig import LJConfig from livejournal.comboboxdialog import ComboBoxDialog from livejournal.dialogcontroller import CommunityDialogController dlg = ComboBoxDialog(self.application.mainWindow, "", "", wx.CB_DROPDOWN | wx.CB_SORT) # dlg.SetModalResult (wx.ID_OK) Tester.dialogTester.appendOk() controller = CommunityDialogController(dlg, self.application, "jenyay") controller.showDialog() Tester.dialogTester.appendOk() controller2 = CommunityDialogController( dlg, self.application, "jenyay_test") controller2.showDialog() Tester.dialogTester.appendOk() controller3 = CommunityDialogController(dlg, self.application, "jenyay") controller3.showDialog() self.assertEqual(LJConfig(self.application.config).communities.value, [ "jenyay", "jenyay_test"]) self.assertEqual(LJConfig(self.application.config).users.value, [""])
def tearDown(self): from livejournal.ljconfig import LJConfig BaseMainWndTest.tearDown(self) LJConfig(Application.config).users.value = [] LJConfig(Application.config).communities.value = [] self.loader.clear()
def tearDown(self): from livejournal.ljconfig import LJConfig LJConfig(self.application.config).users.value = [] LJConfig(self.application.config).communities.value = [] self.loader.clear() Tester.dialogTester.clear() self.destroyApplication() self.destroyWiki(self.wikiroot)
def setUp(self): BaseMainWndTest.setUp(self) self.__pluginname = u"Livejournal" self.__createWiki() self.testPage = self.wikiroot[u"Страница 1"] dirlist = [u"../plugins/livejournal"] self.loader = PluginsLoader(Application) self.loader.load(dirlist) from livejournal.ljconfig import LJConfig LJConfig(Application.config).users.value = [] LJConfig(Application.config).communities.value = []
def setUp(self): self.initApplication() self.wikiroot = self.createWiki() self.__pluginname = "Livejournal" self.__createWiki() self.testPage = self.wikiroot["Страница 1"] dirlist = ["plugins/livejournal"] self.loader = PluginsLoader(self.application) self.loader.load(dirlist) from livejournal.ljconfig import LJConfig LJConfig(self.application.config).users.value = [] LJConfig(self.application.config).communities.value = [] Tester.dialogTester.clear()
def testCommDialog_03(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() controller2 = CommunityDialogController(dlg, Application, u"jenyay") controller2.showDialog() self.assertEqual( LJConfig(Application.config).communities.value, [u"jenyay"]) self.assertEqual(LJConfig(Application.config).users.value, [u""])
def testUserDialog_02(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() valid_result = u"(:ljuser jenyay:)" self.assertEqual(controller.result, valid_result) self.assertEqual(LJConfig(Application.config).users.value, [u"jenyay"])
def testUserDialog_06(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() LJConfig( self.application.config).users.value = ["jenyay", "jenyay_test"] controller = UserDialogController(dlg, self.application, "") controller.showDialog() valid_result = "(:ljuser :)" self.assertEqual(controller.result, valid_result) self.assertEqual(dlg.GetStrings(), ["jenyay", "jenyay_test"])
def testCommDialog_06(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) LJConfig(Application.config).communities.value = [ u"jenyay", u"jenyay_test" ] controller = CommunityDialogController(dlg, Application, u"") controller.showDialog() valid_result = u"(:ljcomm :)" self.assertEqual(controller.result, valid_result) self.assertEqual(dlg.GetStrings(), [u"jenyay", u"jenyay_test"])