summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-04-27 15:03:43 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:16 -0300
commit8eb96fc200e2ecebdd0945475c10c458c308ef2a (patch)
treefb9fab87572bca1fcaa0510613fd4d33bcdbdefd
parent26e45be10730d10f9d04b1c6548ac545106ce643 (diff)
Created unit test for bug 829.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_829.conf2
-rw-r--r--tests/QtCore/bug_829.py18
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index a7cd8b17..fc5fbc55 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -10,6 +10,7 @@ PYSIDE_TEST(bug_699.py)
PYSIDE_TEST(bug_706.py)
PYSIDE_TEST(bug_723.py)
PYSIDE_TEST(bug_724.py)
+PYSIDE_TEST(bug_829.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deepcopy_test.py)
diff --git a/tests/QtCore/bug_829.conf b/tests/QtCore/bug_829.conf
new file mode 100644
index 00000000..90da1ee5
--- /dev/null
+++ b/tests/QtCore/bug_829.conf
@@ -0,0 +1,2 @@
+[General]
+x=@Variant(\0\0\0\x7f\0\0\0\x18PySide::PyObjectWrapper\0\0\0\0\x12(dp0\nI1\nS'a'\np1\ns.)
diff --git a/tests/QtCore/bug_829.py b/tests/QtCore/bug_829.py
new file mode 100644
index 00000000..a805d876
--- /dev/null
+++ b/tests/QtCore/bug_829.py
@@ -0,0 +1,18 @@
+# Test case for PySide bug 829
+# Thomas Perl <thp.io/about>; 2011-04-16
+
+import unittest
+from PySide.QtCore import QSettings
+from helper import adjust_filename
+
+class QVariantConversions(unittest.TestCase):
+ def testDictionary(self):
+ s = QSettings(adjust_filename('bug_829.conf', __file__), QSettings.IniFormat)
+ #Save value
+ s.setValue('x', {1: 'a'})
+ s.sync()
+ #Restore value
+ self.assertEqual(s.value('x'), {1: 'a'})
+
+if __name__ == '__main__':
+ unittest.main()