summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMazhar Hussain <realmazharhussain@gmail.com>2023-02-25 00:20:04 +0500
committerChristoph Reiter <reiter.christoph@gmail.com>2023-03-28 09:54:20 +0000
commit4dbe022d3fc744963823ba915b9b97dd6f917dc7 (patch)
treed9b96f37cc1ed284ffc0a1f56c6f1397c6cf1d0a
parentc129611ea7c11c2e6f68cd2a03d92cea0543d57e (diff)
downloadpygobject-4dbe022d3fc744963823ba915b9b97dd6f917dc7.tar.gz
Add (in)equality tests for Gdk.{Color,RGBA}
-rw-r--r--tests/test_overrides_gdk.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_overrides_gdk.py b/tests/test_overrides_gdk.py
index d9595710..24afa15a 100644
--- a/tests/test_overrides_gdk.py
+++ b/tests/test_overrides_gdk.py
@@ -49,6 +49,10 @@ class TestGdk(unittest.TestCase):
with capture_glib_deprecation_warnings():
self.assertEqual(color, Gdk.Color(100, 200, 300))
self.assertNotEqual(color, Gdk.Color(1, 2, 3))
+ self.assertNotEqual(color, None)
+ # assertNotEqual only tests __ne__. Following line explicitly
+ # tests __eq__ with objects of other types
+ self.assertFalse(color == object())
@unittest.skipIf(GDK4, "not in gdk4")
def test_color_floats(self):
@@ -89,6 +93,10 @@ class TestGdk(unittest.TestCase):
self.assertEqual(rgba.alpha, 0.4)
rgba.green = 0.9
self.assertEqual(rgba.green, 0.9)
+ self.assertNotEqual(rgba, None)
+ # assertNotEqual only tests __ne__. Following line explicitly
+ # tests __eq__ with objects of other types
+ self.assertFalse(rgba == object())
# Iterator/tuple convsersion
self.assertEqual(tuple(Gdk.RGBA(0.1, 0.2, 0.3, 0.4)),