diff options
author | Renato Filho <renato.filho@openbossa.org> | 2010-02-11 12:52:37 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-11 13:03:02 -0300 |
commit | 8b35d247f8649c6b3f64d27ac6a43a8c54e640fd (patch) | |
tree | e051e1b2f2230e9c558787ace162ae38f0b5cc63 /tests | |
parent | aae49f8f9b679d8c0e74e3f5e00c6a8a88791b64 (diff) |
Fixed QMatrix4x4 inject code.
Now QMatrix4x4 constructor supports any PySequence object.
Created unit test for QMatrix4x4 injectcode.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qtgui/qmatrix_test.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/qtgui/qmatrix_test.py b/tests/qtgui/qmatrix_test.py new file mode 100644 index 000000000..6404fef75 --- /dev/null +++ b/tests/qtgui/qmatrix_test.py @@ -0,0 +1,31 @@ +import unittest + +from PySide.QtGui import QMatrix4x4 + +class QMatrixTest(unittest.TestCase): + def testMatrix4x4(self): + self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 3.0]) + self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 'I', + 4.0, 5.0, 6.0, 7.0, + 8.0, 9.0, 'N', 11.0, + 12.0, 'd', 14.0, 'T']) + + my_data = [0.0, 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, 7.0, + 8.0, 9.0, 10.0, 11.0, + 12.0, 13.0, 14.0, 15.0] + my_datac = [0.0, 4.0, 8.0, 12.0, + 1.0, 5.0, 9.0, 13.0, + 2.0, 6.0, 10.0, 14.0, + 3.0, 7.0, 11.0, 15.0] + + m = QMatrix4x4(my_data) + d = m.data() + self.assert_(my_datac, d) + + d = m.copyDataTo() + self.assert_(my_data == list(d)) + +if __name__ == '__main__': + unittest.main() + |