summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-09 14:21:30 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:55 -0300
commitf81fc0390a48512f8e7d95695c2a1e43c49ce573 (patch)
tree4776002ea5ec7caa680678c78e6dc711c54980ac
parentbd26ec914fc417d535c129f46ca54f85e42982bf (diff)
Created unit test for bug #662.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_662.py28
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index d4e91410..7724377a 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 00000000..0b2c1fed
--- /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()