Commit 3090cc70 authored by Martin Pitt's avatar Martin Pitt
Browse files

Test flags and enums in GHash values
parent 88d189ec
......@@ -175,18 +175,24 @@ class TestEverything(unittest.TestCase):
self.assertEqual(result['boolean'], True)
self.assertEqual(result['string'], 'some text')
self.assertEqual(result['strings'], ['first', 'second', 'third'])
self.assertEqual(result['flags'], Everything.TestFlags.FLAG1 | Everything.TestFlags.FLAG3)
self.assertEqual(result['enum'], Everything.TestEnum.VALUE2)
result = None
def test_hash_in(self):
#data = {'integer': 12, 'boolean': True, 'string': 'some text',
# 'strings': ['first', 'second', 'third']}
# above does not work due to
# so use workaround to explicitly build a GStrV object
# specifying a simple string array for "strings" does not work due to
# workaround by explicitly building a GStrv object
class GStrv(list):
__gtype__ = GObject.type_from_name('GStrv')
data = {'integer': 12, 'boolean': True, 'string': 'some text',
'strings': GStrv(['first', 'second', 'third'])}
data = {'integer': 12,
'boolean': True,
'string': 'some text',
'strings': GStrv(['first', 'second', 'third']),
'flags': Everything.TestFlags.FLAG1 | Everything.TestFlags.FLAG3,
'enum': Everything.TestEnum.VALUE2,
data = None
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment