From 50e6f7671db7a561a4832e7ddf6cf1eec326fb93 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Thu, 13 Jan 2011 15:03:16 -0300 Subject: [PATCH] Created unit test for bug #575. Reviewer: Hugo Parente Lima Luciano Wolf --- tests/QtGui/CMakeLists.txt | 1 + tests/QtGui/bug_575.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/QtGui/bug_575.py diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index e8d4804..47d612c 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -26,6 +26,7 @@ PYSIDE_TEST(bug_546.py) PYSIDE_TEST(bug_547.py) PYSIDE_TEST(bug_549.py) PYSIDE_TEST(bug_569.py) +PYSIDE_TEST(bug_575.py) PYSIDE_TEST(bug_576.py) PYSIDE_TEST(bug_585.py) PYSIDE_TEST(bug_589.py) diff --git a/tests/QtGui/bug_575.py b/tests/QtGui/bug_575.py new file mode 100644 index 0000000..e5d34d7 --- /dev/null +++ b/tests/QtGui/bug_575.py @@ -0,0 +1,20 @@ +""" Unittest for bug #575 """ +""" http://bugs.openbossa.org/show_bug.cgi?id=575 """ + +from PySide.QtGui import QApplication, QPlainTextEdit, QTextEdit +import sys +import unittest + +class Bug575(unittest.TestCase): + def testPropertyValues(self): + app = QApplication(sys.argv) + textEdit = QPlainTextEdit() + textEdit.insertPlainText("PySide INdT") + selection = QTextEdit.ExtraSelection() + selection.cursor = textEdit.textCursor() + selection.cursor.setPosition(2) + self.assertEqual(selection.cursor.position(), 2) + +if __name__ == '__main__': + unittest.main() +