From d931b4cf3c4e9fd3bf3e4909f096625da69a78ee Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Wed, 26 Jan 2011 11:45:23 -0200 Subject: Fix bug#605 - "Using metaclasses with the PySide classes doesn't work" --- tests/samplebinding/metaclass_test.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/samplebinding/metaclass_test.py (limited to 'tests') diff --git a/tests/samplebinding/metaclass_test.py b/tests/samplebinding/metaclass_test.py new file mode 100644 index 000000000..3f2ebdaed --- /dev/null +++ b/tests/samplebinding/metaclass_test.py @@ -0,0 +1,33 @@ +from sample import * +import unittest + +class MetaA(type): + pass + +class A(object): + __metaclass__ = MetaA + +MetaB = type(Point) +B = Point + +class MetaC(MetaA, MetaB): + pass +class C(A, B): + __metaclass__ = MetaC + +class D(C): + pass + +class TestMetaClass(unittest.TestCase): + def testIt(self): + w1 = C() # works + w1.setX(1) + w1.setY(2) + + w2 = D() # should work! + w2.setX(3) + w2.setY(4) + + w3 = w1 + w2 + self.assertEqual(w3.x(), 4) + self.assertEqual(w3.y(), 6) -- cgit v1.2.3