diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2009-09-21 14:51:26 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2009-09-21 14:52:09 -0300 |
commit | 9af36fbb64f19842c0cc797c0b586b3a686805e8 (patch) | |
tree | 6bbc050ded0f85517ea75f5dc6dc1ed172168248 /tests/qtcore/qlocale_test.py | |
parent | aa12538d63685ef8f75adaa79411b751929b727d (diff) |
Added all original pyside unit tests to the shiboken version.
Diffstat (limited to 'tests/qtcore/qlocale_test.py')
-rw-r--r-- | tests/qtcore/qlocale_test.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/qtcore/qlocale_test.py b/tests/qtcore/qlocale_test.py new file mode 100644 index 000000000..e2fd49d19 --- /dev/null +++ b/tests/qtcore/qlocale_test.py @@ -0,0 +1,26 @@ +#!/usr/bin/python +'''Unit tests for QLocale''' + +import unittest +import ctypes +import sys + +from PySide.QtCore import QLocale + +class QLocaleTestToNumber(unittest.TestCase): + def testToNumberInt(self): + obj = QLocale(QLocale.C) + self.assertEqual(37, obj.toInt('37')[0]) + + def testToNumberFloat(self): + obj = QLocale(QLocale.C) + self.assertEqual(ctypes.c_float(37.109).value, + obj.toFloat('37.109')[0]) + + def testToNumberDouble(self): + obj = QLocale(QLocale.C) + self.assertEqual(ctypes.c_double(37.109).value, + obj.toDouble('37.109')[0]) + +if __name__ == '__main__': + unittest.main() |