a script for running all the tests
This commit is contained in:
parent
ab70491d56
commit
83d9ef49a3
5 changed files with 33 additions and 21 deletions
|
@ -69,7 +69,7 @@ class MockInterface(Mock):
|
||||||
|
|
||||||
class MockLogger(Mock):
|
class MockLogger(Mock):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Mock.__init__(self, {'write': None})
|
Mock.__init__(self, {'write': None, 'get_transports_type': {}})
|
||||||
|
|
||||||
class MockContact(Mock):
|
class MockContact(Mock):
|
||||||
def __nonzero__(self):
|
def __nonzero__(self):
|
||||||
|
|
16
test/runtests.py
Executable file
16
test/runtests.py
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
# new test modules need to be added manually
|
||||||
|
modules = ( 'test_caps',
|
||||||
|
'test_dispatcher_nb',
|
||||||
|
'test_misc_interface',
|
||||||
|
'test_roster',
|
||||||
|
'test_sessions',
|
||||||
|
)
|
||||||
|
for mod in modules:
|
||||||
|
suite = unittest.defaultTestLoader.loadTestsFromName(mod)
|
||||||
|
unittest.TextTestRunner(verbosity=1).run(suite)
|
||||||
|
|
||||||
|
# vim: se ts=3:
|
|
@ -5,15 +5,10 @@ import testlib
|
||||||
testlib.setup_env()
|
testlib.setup_env()
|
||||||
|
|
||||||
from common import gajim
|
from common import gajim
|
||||||
from common import xmpp
|
|
||||||
|
|
||||||
from common.caps import CapsCache
|
|
||||||
|
|
||||||
from mock import Mock
|
|
||||||
|
|
||||||
from gajim import Interface
|
from gajim import Interface
|
||||||
|
|
||||||
gajim.logger = Mock()
|
from mocks import MockLogger
|
||||||
|
gajim.logger = MockLogger()
|
||||||
|
|
||||||
Interface()
|
Interface()
|
||||||
|
|
||||||
|
|
|
@ -166,6 +166,6 @@ class TestRosterWindowMetaContacts(TestRosterWindowRegrouped):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
# vim: se ts=3:
|
# vim: se ts=3:
|
||||||
|
|
|
@ -3,7 +3,8 @@ import os.path
|
||||||
|
|
||||||
gajim_root = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')
|
gajim_root = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')
|
||||||
|
|
||||||
sys.path.append(gajim_root + '/src')
|
# look for modules in the CWD, then gajim/src, then everywhere else
|
||||||
|
sys.path.insert(1, gajim_root + '/src')
|
||||||
|
|
||||||
# a temporary version of ~/.gajim for testing
|
# a temporary version of ~/.gajim for testing
|
||||||
configdir = gajim_root + '/test/tmp'
|
configdir = gajim_root + '/test/tmp'
|
||||||
|
|
Loading…
Add table
Reference in a new issue