From f81fc0390a48512f8e7d95695c2a1e43c49ce573 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Wed, 9 Feb 2011 14:21:30 -0300 Subject: Created unit test for bug #662. Reviewer: Marcelo Lira Hugo Parente Lima --- tests/QtGui/CMakeLists.txt | 1 + tests/QtGui/bug_662.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 tests/QtGui/bug_662.py diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index d4e914107..7724377a2 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -35,6 +35,7 @@ PYSIDE_TEST(bug_640.py) PYSIDE_TEST(bug_652.py) PYSIDE_TEST(bug_653.py) PYSIDE_TEST(bug_660.py) +PYSIDE_TEST(bug_662.py) PYSIDE_TEST(customproxywidget_test.py) PYSIDE_TEST(deepcopy_test.py) PYSIDE_TEST(float_to_int_implicit_conversion_test.py) diff --git a/tests/QtGui/bug_662.py b/tests/QtGui/bug_662.py new file mode 100644 index 000000000..0b2c1fed6 --- /dev/null +++ b/tests/QtGui/bug_662.py @@ -0,0 +1,28 @@ +''' Test bug 662: http://bugs.openbossa.org/show_bug.cgi?id=662''' + +import unittest +from PySide.QtGui import QTextEdit, QApplication, QTextCharFormat +import sys + +class testQTextBlock(unittest.TestCase): + def tesIterator(self): + edit = QTextEdit() + cursor = edit.textCursor() + fmt = QTextCharFormat() + frags = [] + for i in range(10): + fmt.setFontPointSize(i+10) + frags.append("block%d"%i) + cursor.insertText(frags[i], fmt) + + doc = edit.document() + block = doc.begin() + + index = 0 + for i in block: + self.assertEqual(i.fragment().text(), frags[index]) + index += 1 + +if __name__ == '__main__': + app = QApplication(sys.argv) + unittest.main() -- cgit v1.2.3