summaryrefslogtreecommitdiff
path: root/tests/test_everything.py
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2013-07-24 19:36:28 -0700
committerSimon Feltman <sfeltman@src.gnome.org>2013-07-25 18:11:06 -0700
commitf86701b15ee04c717d9c6bf688101606165e4f83 (patch)
tree64f42cfcf93c5287a49b326898bfb949c0c3544f /tests/test_everything.py
parent6ea41b60691e1ba7e21374582d7aea072af71103 (diff)
downloadpygobject-f86701b15ee04c717d9c6bf688101606165e4f83.tar.gz
tests: Change GHashTable<string,GValue> marshaling test to use GValue
Add test to explicitly use a boxed GStrv GValue in addition to a Python list sub-class. https://bugzilla.gnome.org/show_bug.cgi?id=666636
Diffstat (limited to 'tests/test_everything.py')
-rw-r--r--tests/test_everything.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/test_everything.py b/tests/test_everything.py
index 87b3d2bd..0e593cc1 100644
--- a/tests/test_everything.py
+++ b/tests/test_everything.py
@@ -480,17 +480,15 @@ class TestEverything(unittest.TestCase):
self.assertEqual(Everything.test_ghash_nested_everything_return2(), {})
def test_hash_in(self):
- # specifying a simple string array for "strings" does not work due to
- # https://bugzilla.gnome.org/show_bug.cgi?id=666636
- # workaround by explicitly building a GStrv object
- class GStrv(list):
- __gtype__ = GObject.TYPE_STRV
-
expected = {'foo': 'bar', 'baz': 'bat', 'qux': 'quux'}
Everything.test_ghash_nothing_in(expected)
Everything.test_ghash_nothing_in2(expected)
+ def test_hash_in_with_typed_strv(self):
+ class GStrv(list):
+ __gtype__ = GObject.TYPE_STRV
+
data = {'integer': 12,
'boolean': True,
'string': 'some text',
@@ -501,6 +499,17 @@ class TestEverything(unittest.TestCase):
Everything.test_ghash_gvalue_in(data)
data = None
+ def test_hash_in_with_gvalue_strv(self):
+ data = {'integer': 12,
+ 'boolean': True,
+ 'string': 'some text',
+ 'strings': GObject.Value(GObject.TYPE_STRV, ['first', 'second', 'third']),
+ 'flags': Everything.TestFlags.FLAG1 | Everything.TestFlags.FLAG3,
+ 'enum': Everything.TestEnum.VALUE2,
+ }
+ Everything.test_ghash_gvalue_in(data)
+ data = None
+
def test_struct_gpointer(self):
glist = GLib.List()
raw = RawGList.from_wrapped(glist)