diff options
author | Jacek Konieczny <jajcus@jajcus.net> | 2007-02-03 22:31:43 +0300 |
---|---|---|
committer | Jacek Konieczny <jajcus@jajcus.net> | 2007-02-03 22:31:43 +0300 |
commit | dc8f08812c176236f443a40bfffc91a9bd5ca9d8 (patch) | |
tree | 2733e81442b4f6deb1aa51099e8ff4e520383237 /tests | |
parent | 6a332ecb87d6d5dc3aff0a942a427398a3c922ce (diff) |
- interfaces API improvements
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/interface.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/interface.py b/tests/interface.py index 2914bb2..cfff131 100755 --- a/tests/interface.py +++ b/tests/interface.py @@ -5,12 +5,12 @@ import unittest import pyxmpp.interface import pyxmpp.interface_micro_impl + try: import zope.interface zope_interface_found = True except ImportError: zope_interface_found = False - class TestInterface(unittest.TestCase): interfaces_implementation = None @@ -58,6 +58,17 @@ class TestInterface(unittest.TestCase): self.failIf(I2.providedBy(o1)) self.failIf(I1.providedBy(o2)) + def test_inheritance(self): + class I1(self.interfaces_implementation.Interface): + pass + class I2(I1): + pass + class C1(object): + self.interfaces_implementation.implements(I2) + o1 = C1() + self.failUnless(I1.providedBy(o1)) + self.failUnless(issubclass(I2, I1)) + class TestPyXMPPInterface(TestInterface): interfaces_implementation = pyxmpp.interface |