def testRowsCells(self): dlg = TableRowsDialog(self.mainWindow) controller = TableRowsDialogController(dlg, self._application.config) dlg.colsCount = 5 dlg.rowsCount = 3 Tester.dialogTester.appendOk() controller.showDialog() result = controller.getResult() validResult = '''<tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>''' self.assertEqual(result, validResult, result)
def testRowsCells(self): dlg = TableRowsDialog(self.mainWindow) controller = TableRowsDialogController(dlg, self._application.config) dlg.colsCount = 5 dlg.rowsCount = 3 Tester.dialogTester.appendOk() controller.showDialog() result = controller.getResult() validResult = '''<tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>''' self.assertEqual(result, validResult, result)
def _insertTableRows(self, param): editor = self.codeEditor parent = Application.mainWindow with TableRowsDialog(parent) as dlg: controller = TableRowsDialogController(dlg, Application.config) if controller.showDialog() == wx.ID_OK: result = controller.getResult() editor.replaceText(result)
def _insertTableRows (self, param): editor = self.codeEditor parent = Application.mainWindow with TableRowsDialog (parent) as dlg: controller = TableRowsDialogController (dlg, Application.config) if controller.showDialog() == wx.ID_OK: result = controller.getResult() editor.replaceText (result)
def testDefault(self): dlg = TableRowsDialog(self.wnd) Tester.dialogTester.appendOk() controller = TableRowsDialogController(dlg, self._application.config) controller.showDialog() result = controller.getResult() validResult = u'''<tr> <td></td> </tr>''' self.assertEqual(result, validResult, result)
def testDefault (self): dlg = TableRowsDialog (self.wnd) Tester.dialogTester.appendOk() controller = TableRowsDialogController (dlg, self._application.config) controller.showDialog() result = controller.getResult() validResult = u'''<tr> <td></td> </tr>''' self.assertEqual (result, validResult, result)
def testColsCount(self): dlg = TableRowsDialog(self.mainWindow) Tester.dialogTester.appendOk() controller = TableRowsDialogController(dlg, self._application.config) dlg.colsCount = 10 controller.showDialog() dlg2 = TableRowsDialog(self.mainWindow) controller2 = TableRowsDialogController(dlg2, self._application.config) self.assertEqual(dlg2.colsCount, 10) Tester.dialogTester.appendOk() controller2.showDialog()
def testHCells(self): dlg = TableRowsDialog(self.wnd) controller = TableRowsDialogController(dlg, self._application.config) dlg.colsCount = 5 dlg.rowsCount = 3 dlg.headerCells = True Tester.dialogTester.appendOk() controller.showDialog() result = controller.getResult() validResult = u'''<tr> <th></th> <th></th> <th></th> <th></th> <th></th> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>''' self.assertEqual(result, validResult, result)
def testHCells (self): dlg = TableRowsDialog (self.wnd) controller = TableRowsDialogController (dlg, self._application.config) dlg.colsCount = 5 dlg.rowsCount = 3 dlg.headerCells = True Tester.dialogTester.appendOk() controller.showDialog() result = controller.getResult() validResult = u'''<tr> <th></th> <th></th> <th></th> <th></th> <th></th> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>''' self.assertEqual (result, validResult, result)
def testColsCount(self): dlg = TableRowsDialog(self.mainWindow) Tester.dialogTester.appendOk() controller = TableRowsDialogController(dlg, self._application.config) dlg.colsCount = 10 controller.showDialog() dlg2 = TableRowsDialog(self.mainWindow) controller2 = TableRowsDialogController(dlg2, self._application.config) self.assertEqual(dlg2.colsCount, 10) Tester.dialogTester.appendOk() controller2.showDialog()