diff options
author | Sebastian Pölsterl <sebp@k-d-w.org> | 2011-04-15 15:58:31 +0200 |
---|---|---|
committer | Sebastian Pölsterl <sebp@k-d-w.org> | 2011-04-15 15:58:31 +0200 |
commit | cfccd55128377864e3a42a64785637bd453621b2 (patch) | |
tree | 978b21d8c8527b1e40f7766cb45b236a6ccb4c3e | |
parent | 666ec192a4369e2fae508261a7a81b34326fc227 (diff) | |
download | pygobject-cfccd55128377864e3a42a64785637bd453621b2.tar.gz |
[gi] Added additional test case for GVariant handling
-rw-r--r-- | tests/test_overrides.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_overrides.py b/tests/test_overrides.py index 3421c3a8..57abdfd0 100644 --- a/tests/test_overrides.py +++ b/tests/test_overrides.py @@ -190,6 +190,21 @@ class TestGLib(unittest.TestCase): self.assertEqual(variant.get_type_string(), '(ia{sa{sb}}s)') self.assertEqual(variant.unpack(), obj) + obj = {"frequency": GLib.Variant('t', 738000000), + "hierarchy": GLib.Variant('i', 0), + "bandwidth": GLib.Variant('x', 8), + "code-rate-hp": GLib.Variant('d', 2.0/3.0), + "constellation": GLib.Variant('s', "QAM16"), + "guard-interval": GLib.Variant('u', 4),} + variant = GLib.Variant('a{sv}', obj) + self.assertEqual(variant.get_type_string(), 'a{sv}') + self.assertEqual(variant.unpack(), {"frequency": 738000000, + "hierarchy": 0, + "bandwidth": 8, + "code-rate-hp": 2.0/3.0, + "constellation": "QAM16", + "guard-interval": 4}) + def test_gvariant_create_errors(self): # excess arguments self.assertRaises(TypeError, GLib.Variant, 'i', 42, 3) |