[pygi] Fix overrides.Gdk.Color.__new__ args



commit 2674a9546b0246d4a75d71cf1708df77dc0173f9
Author: Tomeu Vizoso <tomeu sugarlabs org>
Date:   Wed May 5 15:54:39 2010 +0200

    Fix overrides.Gdk.Color.__new__ args
    
    https://bugzilla.gnome.org/show_bug.cgi?id=617757

 gi/overrides/Gdk.py     |    2 +-
 tests/Makefile.am       |    3 ++-
 tests/test_overrides.py |   22 ++++++++++++++++++++++
 3 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py
index 4578ca8..de35870 100644
--- a/gi/overrides/Gdk.py
+++ b/gi/overrides/Gdk.py
@@ -52,7 +52,7 @@ class Color(Gdk.Color):
         self.g = g
         self.b = b
 
-    def __new__(cls):
+    def __new__(cls, *args, **kwargs):
         return Gdk.Color.__new__(cls)
 
     def __repr__(self):
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f4e9345..f8a65dc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,8 @@
 noinst_PYTHON = \
 	runtests.py \
 	test_everything.py \
-	test_gi.py
+	test_gi.py \
+	test_overrides.py
 
 check-local:
 	LD_LIBRARY_PATH=$(srcdir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
new file mode 100644
index 0000000..90a2426
--- /dev/null
+++ b/tests/test_overrides.py
@@ -0,0 +1,22 @@
+# -*- Mode: Python; py-indent-offset: 4 -*-
+# vim: tabstop=4 shiftwidth=4 expandtab
+
+import pygtk
+pygtk.require("2.0")
+
+import unittest
+import gobject
+
+import sys
+sys.path.insert(0, "../")
+
+from gi.repository import Gdk
+
+class TestGdk(unittest.TestCase):
+
+    def test_color(self):
+        color = Gdk.Color(100, 200, 300)
+        self.assertEquals(color.r, 100)
+        self.assertEquals(color.g, 200)
+        self.assertEquals(color.b, 300)
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]