Revision 5207c784 kamaki/clients/tests/__init__.py
b/kamaki/clients/tests/__init__.py | ||
---|---|---|
31 | 31 |
# interpreted as representing official policies, either expressed |
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 |
from unittest import TestCase, TestSuite, makeSuite, TextTestRunner |
|
34 |
import inspect |
|
35 |
from unittest import TestCase, TestSuite, TextTestRunner |
|
35 | 36 |
from argparse import ArgumentParser |
36 | 37 |
from sys import stdout |
37 | 38 |
from progress.bar import ShadyBar |
... | ... | |
45 | 46 |
return foo(self, value) |
46 | 47 |
return wrap |
47 | 48 |
|
49 |
|
|
48 | 50 |
class Generic(TestCase): |
49 | 51 |
|
50 | 52 |
_waits = [] |
... | ... | |
128 | 130 |
self.assertEqual(unicode(v), unicode(d2[k])) |
129 | 131 |
|
130 | 132 |
def test_000(self): |
131 |
import inspect
|
|
133 |
print('')
|
|
132 | 134 |
methods = [method for method in inspect.getmembers( |
133 | 135 |
self, |
134 | 136 |
predicate=inspect.ismethod)\ |
... | ... | |
177 | 179 |
suiteFew.addTest(Image(test_method, config)) |
178 | 180 |
if len(argv) == 0 or argv[0] == 'astakos': |
179 | 181 |
from kamaki.clients.tests.astakos import Astakos |
180 |
if len(argv) == 1: |
|
181 |
suiteFew.addTest(makeSuite(Astakos, config)) |
|
182 |
else: |
|
183 |
suiteFew.addTest(Astakos('test_' + argv[1], config)) |
|
182 |
test_method = 'test_%s' % (argv[1] if len(argv) > 1 else '000') |
|
183 |
suiteFew.addTest(Astakos(test_method, config)) |
|
184 | 184 |
|
185 | 185 |
TextTestRunner(verbosity=2).run(suiteFew) |
186 | 186 |
|
... | ... | |
188 | 188 |
parser = init_parser() |
189 | 189 |
args, argv = parser.parse_known_args() |
190 | 190 |
if len(argv) > 2 or getattr(args, 'help') or len(argv) < 1: |
191 |
raise Exception('\tusage: tests.py <group> [command]')
|
|
191 |
raise Exception('\tusage: tests <group> [command]') |
|
192 | 192 |
main(argv) |
Also available in: Unified diff