diff options
author | Jacek Konieczny <jajcus@jajcus.net> | 2004-12-31 23:26:41 +0300 |
---|---|---|
committer | Jacek Konieczny <jajcus@jajcus.net> | 2004-12-31 23:26:41 +0300 |
commit | bf7bbb6f29a3f24ad8e24dcf67a232f2288758cc (patch) | |
tree | 7f49ab0c83c24a0ea73e27d947e4c4a09d64e892 /tests | |
parent | 01487c15d2b72a08efec3948d3156bc581e3b78b (diff) |
- BACKWARD INCOMPATIBLE CHANGES:
- no submodules are imported directly from pyxmpp, pyxmpp.jabber and
pyxmpp.jabberd (reduces startup time for apps using only small part of the
API)
- pyxmpp.all, pyxmpp.jabber.all and pyxmpp.jabberd.all modules for backward
compatibility and convienience
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/all.py | 2 | ||||
-rwxr-xr-x | tests/imports.py | 48 |
2 files changed, 49 insertions, 1 deletions
diff --git a/tests/all.py b/tests/all.py index 162b9bc..327e6de 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4,7 +4,7 @@ import unittest import sys import getopt -all_modules=["vcard","jid","disco"] +all_modules=["vcard","jid","disco","imports"] def suite(modules=None): if not modules: diff --git a/tests/imports.py b/tests/imports.py new file mode 100755 index 0000000..3dc03e2 --- /dev/null +++ b/tests/imports.py @@ -0,0 +1,48 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +import unittest + +import pyxmpp.all as pyxmpp +import pyxmpp.jabber.all +import pyxmpp.jabberd.all + +class TestImports(unittest.TestCase): + def test_Stream(self): + import pyxmpp.stream as m2 + self.failUnless(pyxmpp.Stream is m2.Stream,"Stream not imported correctly") + def test_Stream_from(self): + from pyxmpp import Stream as n1 + import pyxmpp.stream as m2 + self.failUnless(n1 is m2.Stream,"Stream not imported correctly") + def test_JID(self): + import pyxmpp.jid as m2 + self.failUnless(pyxmpp.JID is m2.JID,"JID not imported correctly") + def test_JID_from(self): + from pyxmpp import JID as n1 + import pyxmpp.jid as m2 + self.failUnless(n1 is m2.JID,"JID not imported correctly") + def test_JabberClient(self): + import pyxmpp.jabber.client as m2 + self.failUnless(pyxmpp.jabber.Client is m2.JabberClient,"JabberClient not imported correctly") + def test_JabberClient_from(self): + from pyxmpp.jabber import Client as n1 + import pyxmpp.jabber.client as m2 + self.failUnless(n1 is m2.JabberClient,"JabberClient not imported correctly") + def test_Component(self): + import pyxmpp.jabberd.component as m2 + self.failUnless(pyxmpp.jabberd.Component is m2.Component,"Component not imported correctly") + def test_Component_from(self): + from pyxmpp.jabberd import Component as n1 + import pyxmpp.jabberd.component as m2 + self.failUnless(n1 is m2.Component,"Component not imported correctly") + +def suite(): + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(TestImports)) + return suite + +if __name__ == '__main__': + unittest.TextTestRunner(verbosity=2).run(suite()) + +# vi: sts=4 et sw=4 encoding=utf-8 |