From 77be0fc1a7927022347104162b4bd42f0cbb01a8 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Wed, 6 Apr 2011 21:25:50 -0300 Subject: Fixes bugs 739 and 752. Bug #739 - Method "QTransform::map(qreal x, qreal y, qreal* tx, qreal* ty) const" missing Bug #752 - Method "void QSplitter::getRange(int index, int* min, int* max) const" missing Also added unit tests. --- tests/QtGui/CMakeLists.txt | 2 ++ tests/QtGui/qsplitter_test.py | 16 ++++++++++++++++ tests/QtGui/qtransform_test.py | 16 ++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 tests/QtGui/qsplitter_test.py create mode 100644 tests/QtGui/qtransform_test.py (limited to 'tests/QtGui') diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index ef62638fc..515c2e235 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -95,6 +95,7 @@ PYSIDE_TEST(qpushbutton_test.py) PYSIDE_TEST(qradialgradient_test.py) PYSIDE_TEST(qregion_test.py) PYSIDE_TEST(qshortcut_test.py) +PYSIDE_TEST(qsplitter_test.py) PYSIDE_TEST(qstandarditemmodel_test.py) PYSIDE_TEST(qstring_qkeysequence_test.py) PYSIDE_TEST(qstyle_test.py) @@ -104,6 +105,7 @@ PYSIDE_TEST(qtextedit_test.py) PYSIDE_TEST(qtextedit_signal_test.py) PYSIDE_TEST(qtoolbar_test.py) PYSIDE_TEST(qtoolbox_test.py) +PYSIDE_TEST(qtransform_test.py) PYSIDE_TEST(qvariant_test.py) PYSIDE_TEST(qvalidator_test.py) PYSIDE_TEST(qwidget_setlayout_test.py) diff --git a/tests/QtGui/qsplitter_test.py b/tests/QtGui/qsplitter_test.py new file mode 100644 index 000000000..a438b6949 --- /dev/null +++ b/tests/QtGui/qsplitter_test.py @@ -0,0 +1,16 @@ +import unittest +from PySide.QtGui import QSplitter + +from helper import UsesQApplication + +class QSplitterTest(UsesQApplication): + + def testGetRange(self): + splitter = QSplitter() + _min, _max = splitter.getRange(0) + self.assert_(isinstance(_min, int)) + self.assert_(isinstance(_max, int)) + +if __name__ == "__main__": + unittest.main() + diff --git a/tests/QtGui/qtransform_test.py b/tests/QtGui/qtransform_test.py new file mode 100644 index 000000000..450bf3292 --- /dev/null +++ b/tests/QtGui/qtransform_test.py @@ -0,0 +1,16 @@ +import unittest +from PySide.QtGui import QTransform + +class QTransformTest(unittest.TestCase): + + def testMap(self): + transform = QTransform() + values = (10.0, 20.0) + tx, ty = transform.map(*values) + self.assert_(isinstance(tx, float)) + self.assert_(isinstance(ty, float)) + self.assertEqual((tx, ty), values) + +if __name__ == "__main__": + unittest.main() + -- cgit v1.2.3