aboutsummaryrefslogtreecommitdiff
path: root/tests/client/script_modeltest.py
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-15 17:22:27 -0300
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-15 17:22:27 -0300
commita98d5486c37d68e1c1ce8fc1b6ad0a9018dd534d (patch)
tree034883ffc3494ca53c66272773990ae4ff744373 /tests/client/script_modeltest.py
parent7f0972362c6969fbf306945fc76f23b716400794 (diff)
downloadqmenumodel-a98d5486c37d68e1c1ce8fc1b6ad0a9018dd534d.tar.gz
qmenumodel-a98d5486c37d68e1c1ce8fc1b6ad0a9018dd534d.tar.bz2
qmenumodel-a98d5486c37d68e1c1ce8fc1b6ad0a9018dd534d.zip
Created unit test for QVariantMap conversion;
Diffstat (limited to 'tests/client/script_modeltest.py')
-rwxr-xr-xtests/client/script_modeltest.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/client/script_modeltest.py b/tests/client/script_modeltest.py
index db4e28b..95df442 100755
--- a/tests/client/script_modeltest.py
+++ b/tests/client/script_modeltest.py
@@ -5,6 +5,12 @@ from gi.repository import GLib
from menuscript import Script, ActionList, MENU_OBJECT_PATH
al = ActionList(MENU_OBJECT_PATH)
+
+# create map
+pmap = {'int64' : GLib.Variant('x', -42),
+ 'string': GLib.Variant('s', u'42'),
+ 'double': GLib.Variant('d', 42.42)}
+
al.appendItem("Menu0", "Menu0Act", None, None, {'x-boolean' : GLib.Variant('b', True),
'x-byte' : GLib.Variant('y', 42),
'x-int16' : GLib.Variant('n', -42),
@@ -14,7 +20,8 @@ al.appendItem("Menu0", "Menu0Act", None, None, {'x-boolean' : GLib.Variant('b',
'x-int64' : GLib.Variant('x', -42),
'x-uint64' : GLib.Variant('t', 42),
'x-double' : GLib.Variant('d', 42.42),
- 'x-string' : GLib.Variant('s', u'42')
+ 'x-string' : GLib.Variant('s', u'42'),
+ 'x-map' : GLib.Variant('a{sv}', pmap),
})
al.appendItem("Menu1", "Menu1Act")