summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-09 14:21:30 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-09 15:46:29 -0300
commit323b37bedadbef313a513ded818e326b6e5f2dcd (patch)
tree5a21a8320acd1fd9afd28b944b3f47324e50c0aa
parent0fe1c15cbfc841205d490939f54614fedd1c99cc (diff)
downloadpyside-323b37bedadbef313a513ded818e326b6e5f2dcd.tar.gz
pyside-323b37bedadbef313a513ded818e326b6e5f2dcd.tar.xz
pyside-323b37bedadbef313a513ded818e326b6e5f2dcd.zip
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 d4e9141..7724377 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 0000000..0b2c1fe
--- /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()