From c5aff6f37c7d40e2d09e3bffcdbbdd0a2f0735e3 Mon Sep 17 00:00:00 2001 From: Stephan Erb Date: Wed, 24 Dec 2008 14:44:07 +0000 Subject: [PATCH] Make test_resolver work again after IdleQueue move. --- test/test_resolver.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/test_resolver.py b/test/test_resolver.py index 4cab122a0..39794004b 100644 --- a/test/test_resolver.py +++ b/test/test_resolver.py @@ -6,14 +6,13 @@ import lib lib.setup_env() from common import resolver -from gajim import GlibIdleQueue +from common.xmpp.idlequeue import GlibIdleQueue from mock import Mock, expectParams from mocks import * import gtk - GMAIL_SRV_NAME = '_xmpp-client._tcp.gmail.com' NONSENSE_NAME = 'sfsdfsdfsdf.sdfs.fsd' JABBERCZ_TXT_NAME = '_xmppconnect.jabber.cz' @@ -24,6 +23,8 @@ TEST_LIST = [(GMAIL_SRV_NAME, 'srv', True), (JABBERCZ_SRV_NAME, 'srv', True)] class TestResolver(unittest.TestCase): + ''' Test for LibAsyncNSResolver and NSLookupResolver ''' + def setUp(self): self.iq = GlibIdleQueue() self.reset() @@ -56,19 +57,18 @@ class TestResolver(unittest.TestCase): time.sleep(1) self.resolver.process() - def myonready(self, name, result_set): - print 'on_ready called ...' - print 'hostname: %s' % name - print 'result set: %s' % result_set - print 'res.resolved_hosts: %s' % self.resolver.resolved_hosts + if __name__ == '__main__': + print 'on_ready called ...' + print 'hostname: %s' % name + print 'result set: %s' % result_set + print 'res.resolved_hosts: %s' % self.resolver.resolved_hosts if self.expect_results: self.assert_(len(result_set) > 0) else: self.assert_(result_set == []) self.flag = True if self.nslookup: self._testNSLR() - def testNSLookupResolver(self): self.reset() @@ -93,3 +93,5 @@ class TestResolver(unittest.TestCase): if __name__ == '__main__': unittest.main() + +# vim: se ts=3: