Fix unit test of bug 829.
This commit is contained in:
parent
0971ac7c4f
commit
2e1ff21938
2 changed files with 8 additions and 5 deletions
|
|
@ -1,2 +0,0 @@
|
||||||
[General]
|
|
||||||
x=@Variant(\0\0\0\x7f\0\0\0\x18PySide::PyObjectWrapper\0\0\0\0\x12(dp0\nI1\nS'a'\np1\ns.)
|
|
||||||
|
|
@ -4,14 +4,19 @@
|
||||||
import unittest
|
import unittest
|
||||||
from PySide.QtCore import QSettings
|
from PySide.QtCore import QSettings
|
||||||
from helper import adjust_filename
|
from helper import adjust_filename
|
||||||
|
import tempfile
|
||||||
|
|
||||||
class QVariantConversions(unittest.TestCase):
|
class QVariantConversions(unittest.TestCase):
|
||||||
def testDictionary(self):
|
def testDictionary(self):
|
||||||
s = QSettings(adjust_filename('bug_829.conf', __file__), QSettings.IniFormat)
|
confFile = tempfile.NamedTemporaryFile()
|
||||||
#Save value
|
s = QSettings(confFile.name, QSettings.IniFormat)
|
||||||
|
# Save value
|
||||||
s.setValue('x', {1: 'a'})
|
s.setValue('x', {1: 'a'})
|
||||||
s.sync()
|
s.sync()
|
||||||
#Restore value
|
del s
|
||||||
|
|
||||||
|
# Restore value
|
||||||
|
s = QSettings(confFile.name, QSettings.IniFormat)
|
||||||
self.assertEqual(s.value('x'), {1: 'a'})
|
self.assertEqual(s.value('x'), {1: 'a'})
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue