Exemplo n.º 1
0
    def testBlockComments(self):
        b = BlockInfo(None, "/Foo", True, "")
        c = "some comments"
        e = BlockEditor(b, self.tree.app_info.type_to_block_map)
        self.checkWidget(e)
        self.assertEqual(b.comments, "")
        e.comment_edit.setComments(c)
        self.checkWidget(e, apply_enabled=True, reset_enabled=True, comments=c)
        # This should get updated after apply is pressed
        self.assertEqual(b.comments, "")
        e.applyChanges()
        self.assertEqual(b.comments, c)
        self.checkWidget(e, comments=c)

        e.resetChanges()
        self.checkWidget(e, comments=c)

        e.comment_edit.setComments("")
        self.checkWidget(e, apply_enabled=True, reset_enabled=True, comments="")
        self.assertEqual(b.comments, c)
        e.resetChanges()
        self.checkWidget(e, comments=c)
        self.assertEqual(b.comments, c)
Exemplo n.º 2
0
 def testEmpty(self):
     b = BlockInfo(None, "/Foo")
     t = ParamsTable(b, [], {})
     t.needBlockList.connect(lambda paths: self.needBlockList(t, paths))
     self.assertEqual(t.rowCount(), 0)
     t.setWatchedBlockList("/Bar", [])
Exemplo n.º 3
0
 def testEmpty(self):
     b = BlockInfo(None, "Foo")
     t = self.createWidget(b)
     self.assertEqual(t.combo.count(), 0)
     self.assertEqual(t.table_stack.count(), 0)