diff options
Diffstat (limited to 'tests/test_overrides_gdk.py')
-rw-r--r-- | tests/test_overrides_gdk.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_overrides_gdk.py b/tests/test_overrides_gdk.py index 070acb8..46f0a38 100644 --- a/tests/test_overrides_gdk.py +++ b/tests/test_overrides_gdk.py @@ -117,3 +117,25 @@ class TestGdk(unittest.TestCase): self.assertNotEqual(c, None) self.assertRaises(ValueError, Gdk.Cursor, 1, 2, 3) + + def test_flags(self): + self.assertEqual(Gdk.ModifierType.META_MASK | 0, 0x10000000) + self.assertEqual(hex(Gdk.ModifierType.META_MASK), '0x10000000') + self.assertEqual(str(Gdk.ModifierType.META_MASK), + '<flags GDK_META_MASK of type GdkModifierType>') + + self.assertEqual(Gdk.ModifierType.RELEASE_MASK | 0, 0x40000000) + self.assertEqual(hex(Gdk.ModifierType.RELEASE_MASK), '0x40000000') + self.assertEqual(str(Gdk.ModifierType.RELEASE_MASK), + '<flags GDK_RELEASE_MASK of type GdkModifierType>') + + self.assertEqual(Gdk.ModifierType.RELEASE_MASK | Gdk.ModifierType.META_MASK, 0x50000000) + self.assertEqual(str(Gdk.ModifierType.RELEASE_MASK | Gdk.ModifierType.META_MASK), + '<flags GDK_META_MASK | GDK_RELEASE_MASK of type GdkModifierType>') + + def test_color_parse(self): + c = Gdk.color_parse('#00FF80') + self.assertEqual(c.red, 0) + self.assertEqual(c.green, 65535) + self.assertEqual(c.blue, 32896) + self.assertEqual(Gdk.color_parse('bogus'), None) |