forked from Trust-Code/python-boleto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalltests.py
More file actions
39 lines (34 loc) · 1.11 KB
/
alltests.py
File metadata and controls
39 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
def suite():
"""suite that tests all banks"""
def my_import(name):
# See http://docs.python.org/lib/built-in-funcs.html#l2h-6
components = name.split('.')
try:
# python setup.py test
mod = __import__(name)
for comp in components[1:]:
mod = getattr(mod, comp)
except ImportError:
# python tests/alltests.py
mod = __import__(components[1])
return mod
modules_to_test = [
'tests.test_banco_banrisul',
'tests.test_banco_bradesco',
'tests.test_banco_caixa',
'tests.test_banco_do_brasil',
'tests.test_banco_hsbc',
'tests.test_banco_hsbc_com_registro',
'tests.test_banco_itau',
'tests.test_banco_real',
'tests.test_banco_santander',
]
alltests = unittest.TestSuite()
for module in [my_import(x) for x in modules_to_test]:
alltests.addTest(module.suite)
return alltests
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())