diff options
author | lovetox <philipp@hoerist.com> | 2020-03-16 00:49:03 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2020-03-16 00:49:20 +0300 |
commit | b62bda87b0e26386503309baebe3d6aceb4118ce (patch) | |
tree | 5dede114f269831b8809fc9ee37eb41292199eb9 /test/integration | |
parent | e395205d791e0edcb1eaacd2a7d5b2549887b7e7 (diff) |
Remove resolver code
nbxmpp does all the resolving
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/__init__.py | 6 | ||||
-rw-r--r-- | test/integration/test_resolver.py | 69 |
2 files changed, 0 insertions, 75 deletions
diff --git a/test/integration/__init__.py b/test/integration/__init__.py deleted file mode 100644 index aaeacfbef..000000000 --- a/test/integration/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -''' - -This package contains integration tests. Integration tests are tests -which require or include UI, network or both. - -''' diff --git a/test/integration/test_resolver.py b/test/integration/test_resolver.py deleted file mode 100644 index 2354f70cf..000000000 --- a/test/integration/test_resolver.py +++ /dev/null @@ -1,69 +0,0 @@ -import unittest - -from test import lib -lib.setup_env() - -from gi.repository import GLib - -from gajim.common import resolver - -NONSENSE_NAME = 'sfsdfsdfsdf.sdfs.fsd' -JABBERCZ_TXT_NAME = '_xmppconnect.jabber.cz' -JABBERCZ_SRV_NAME = '_xmpp-client._tcp.jabber.cz' - -TEST_LIST = [(NONSENSE_NAME, 'srv', False), - (JABBERCZ_SRV_NAME, 'srv', True)] - - -class TestResolver(unittest.TestCase): - ''' - Test for LibAsyncNSResolver and NSLookupResolver. Requires working - network connection. - ''' - def setUp(self): - self.main_context = GLib.MainContext() - self.main_context.push_thread_default() - self.main_loop = GLib.MainLoop(self.main_context) - self._reset() - self.resolver = None - - def tearDown(self): - self.main_context.pop_thread_default() - - def _reset(self): - self.expect_results = False - self.resolver = None - - def testGioResolver(self): - self._reset() - self.resolver = resolver.GioResolver() - - for name, type_, expect_results in TEST_LIST: - self.expect_results = expect_results - self._runGR(name, type_) - - def _runGR(self, name, type_): - self.resolver.resolve( - host=name, - type_=type_, - on_ready=self._myonready) - - self.main_loop.run() - - def _myonready(self, name, result_set): - if __name__ == '__main__': - from pprint import pprint - pprint('on_ready called ...') - pprint('hostname: %s' % name) - pprint('result set: %s' % result_set) - pprint('res.resolved_hosts: %s' % self.resolver.resolved_hosts) - pprint('') - if self.expect_results: - self.assertTrue(len(result_set) > 0) - else: - self.assertTrue(result_set == []) - self.main_loop.quit() - - -if __name__ == '__main__': - unittest.main() |