コード例 #1
0
ファイル: wikitabledialog.py プロジェクト: LihMeh/outwiker
    def testRowsCells (self):
        suffix = u''
        dlg = TableDialog (self.wnd)
        controller = TableDialogController (dlg, suffix, self._application.config)

        dlg.colsCount = 5
        dlg.rowsCount = 3
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = u'''(:table border="1":)
(:row:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:row:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:row:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:tableend:)'''

        self.assertEqual (result, validResult, result)
コード例 #2
0
    def testColsCount (self):
        dlg = TableDialog (self.wnd)
        Tester.dialogTester.appendOk()

        controller = TableDialogController (dlg, self._application.config)
        dlg.colsCount = 10
        controller.showDialog()

        dlg2 = TableDialog (self.wnd)
        controller2 = TableDialogController (dlg2, self._application.config)

        self.assertEqual (dlg2.colsCount, 10)

        Tester.dialogTester.appendOk()
        controller2.showDialog()
コード例 #3
0
    def testColsCount(self):
        suffix = ''
        dlg = TableDialog(self.mainWindow)
        Tester.dialogTester.appendOk()

        controller = TableDialogController(dlg, suffix,
                                           self.application.config)
        dlg.colsCount = 10
        controller.showDialog()

        dlg2 = TableDialog(self.mainWindow)
        controller2 = TableDialogController(dlg2, suffix,
                                            self.application.config)

        self.assertEqual(dlg2.colsCount, 10)

        Tester.dialogTester.appendOk()
        controller2.showDialog()
コード例 #4
0
    def testColsCount(self):
        suffix = ''
        dlg = TableDialog(self.mainWindow)
        Tester.dialogTester.appendOk()

        controller = TableDialogController(dlg,
                                           suffix,
                                           self.application.config)
        dlg.colsCount = 10
        controller.showDialog()

        dlg2 = TableDialog(self.mainWindow)
        controller2 = TableDialogController(dlg2,
                                            suffix,
                                            self.application.config)

        self.assertEqual(dlg2.colsCount, 10)

        Tester.dialogTester.appendOk()
        controller2.showDialog()
コード例 #5
0
    def testCells (self):
        dlg = TableDialog (self.wnd)
        controller = TableDialogController (dlg, self._application.config)

        dlg.colsCount = 5
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = u'''<table border="1">
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>'''

        self.assertEqual (result, validResult, result)
コード例 #6
0
    def testHCells(self):
        dlg = TableDialog(self.mainWindow)
        controller = TableDialogController(dlg, self.application.config)

        dlg.colsCount = 5
        dlg.rowsCount = 3
        dlg.headerCells = True
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = '''<table border="1">
<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>
</table>'''

        self.assertEqual(result, validResult, result)
コード例 #7
0
    def testHCells(self):
        suffix = ''
        dlg = TableDialog(self.mainWindow)
        controller = TableDialogController(dlg,
                                           suffix,
                                           self.application.config)

        dlg.colsCount = 5
        dlg.rowsCount = 3
        dlg.headerCells = True
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = '''(:table border="1":)
(:row:)
(:hcell:)
(:hcell:)
(:hcell:)
(:hcell:)
(:hcell:)
(:row:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:row:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:tableend:)'''

        self.assertEqual(result, validResult, result)
コード例 #8
0
    def testHCells(self):
        dlg = TableDialog(self.mainWindow)
        controller = TableDialogController(dlg, self.application.config)

        dlg.colsCount = 5
        dlg.rowsCount = 3
        dlg.headerCells = True
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = '''<table border="1">
<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>
</table>'''

        self.assertEqual(result, validResult, result)
コード例 #9
0
    def testCells(self):
        suffix = u''
        dlg = TableDialog(self.wnd)
        controller = TableDialogController(dlg, suffix,
                                           self._application.config)

        dlg.colsCount = 5
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = u'''(:table border="1":)
(:row:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:tableend:)'''

        self.assertEqual(result, validResult, result)
コード例 #10
0
    def testHCells(self):
        suffix = ''
        dlg = TableDialog(self.mainWindow)
        controller = TableDialogController(dlg, suffix,
                                           self.application.config)

        dlg.colsCount = 5
        dlg.rowsCount = 3
        dlg.headerCells = True
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = '''(:table border="1":)
(:row:)
(:hcell:)
(:hcell:)
(:hcell:)
(:hcell:)
(:hcell:)
(:row:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:row:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:cell:)
(:tableend:)'''

        self.assertEqual(result, validResult, result)