Make test_resolver work again after IdleQueue move.
This commit is contained in:
parent
40d802284e
commit
c5aff6f37c
|
@ -6,14 +6,13 @@ import lib
|
||||||
lib.setup_env()
|
lib.setup_env()
|
||||||
|
|
||||||
from common import resolver
|
from common import resolver
|
||||||
from gajim import GlibIdleQueue
|
from common.xmpp.idlequeue import GlibIdleQueue
|
||||||
|
|
||||||
from mock import Mock, expectParams
|
from mock import Mock, expectParams
|
||||||
from mocks import *
|
from mocks import *
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
|
|
||||||
GMAIL_SRV_NAME = '_xmpp-client._tcp.gmail.com'
|
GMAIL_SRV_NAME = '_xmpp-client._tcp.gmail.com'
|
||||||
NONSENSE_NAME = 'sfsdfsdfsdf.sdfs.fsd'
|
NONSENSE_NAME = 'sfsdfsdfsdf.sdfs.fsd'
|
||||||
JABBERCZ_TXT_NAME = '_xmppconnect.jabber.cz'
|
JABBERCZ_TXT_NAME = '_xmppconnect.jabber.cz'
|
||||||
|
@ -24,6 +23,8 @@ TEST_LIST = [(GMAIL_SRV_NAME, 'srv', True),
|
||||||
(JABBERCZ_SRV_NAME, 'srv', True)]
|
(JABBERCZ_SRV_NAME, 'srv', True)]
|
||||||
|
|
||||||
class TestResolver(unittest.TestCase):
|
class TestResolver(unittest.TestCase):
|
||||||
|
''' Test for LibAsyncNSResolver and NSLookupResolver '''
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.iq = GlibIdleQueue()
|
self.iq = GlibIdleQueue()
|
||||||
self.reset()
|
self.reset()
|
||||||
|
@ -56,12 +57,12 @@ class TestResolver(unittest.TestCase):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
self.resolver.process()
|
self.resolver.process()
|
||||||
|
|
||||||
|
|
||||||
def myonready(self, name, result_set):
|
def myonready(self, name, result_set):
|
||||||
print 'on_ready called ...'
|
if __name__ == '__main__':
|
||||||
print 'hostname: %s' % name
|
print 'on_ready called ...'
|
||||||
print 'result set: %s' % result_set
|
print 'hostname: %s' % name
|
||||||
print 'res.resolved_hosts: %s' % self.resolver.resolved_hosts
|
print 'result set: %s' % result_set
|
||||||
|
print 'res.resolved_hosts: %s' % self.resolver.resolved_hosts
|
||||||
if self.expect_results:
|
if self.expect_results:
|
||||||
self.assert_(len(result_set) > 0)
|
self.assert_(len(result_set) > 0)
|
||||||
else:
|
else:
|
||||||
|
@ -69,7 +70,6 @@ class TestResolver(unittest.TestCase):
|
||||||
self.flag = True
|
self.flag = True
|
||||||
if self.nslookup: self._testNSLR()
|
if self.nslookup: self._testNSLR()
|
||||||
|
|
||||||
|
|
||||||
def testNSLookupResolver(self):
|
def testNSLookupResolver(self):
|
||||||
self.reset()
|
self.reset()
|
||||||
self.nslookup = True
|
self.nslookup = True
|
||||||
|
@ -93,3 +93,5 @@ class TestResolver(unittest.TestCase):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
# vim: se ts=3:
|
||||||
|
|
Loading…
Reference in New Issue