aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore/bug_829.py
blob: da527ad49e13efd22d9c3779fa222474850a4fe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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
import tempfile

class QVariantConversions(unittest.TestCase):
    def testDictionary(self):
        confFile = tempfile.NamedTemporaryFile()
        s = QSettings(confFile.name, QSettings.IniFormat)
        # Save value
        s.setValue('x', {1: 'a'})
        s.sync()
        del s

        # Restore value
        s = QSettings(confFile.name, QSettings.IniFormat)
        self.assertEqual(s.value('x'), {1: 'a'})

if __name__ == '__main__':
    unittest.main()