Revision d1f78278 kamaki/clients/tests/__init__.py

b/kamaki/clients/tests/__init__.py
45 45
        return foo(self, value)
46 46
    return wrap
47 47

  
48

  
49 48
class Generic(TestCase):
50 49

  
51 50
    _waits = []
......
53 52
    _grp = None
54 53
    _fetched = {}
55 54

  
56
    def __init__(self, specific=None, config_file=None, group=None):
55
    def __init__(self, specific=None, config=None, group=None):
57 56
        super(Generic, self).__init__(specific)
58
        self._cnf = Config(config_file)
57
        self._cnf = config or Config()
59 58
        self._grp = group
60 59
        self._waits.append(0.71828)
61 60
        for i in range(10):
......
111 110
            return
112 111
        (action_bar, action_cb) = self._safe_progress_bar(msg)
113 112
        action_gen = action_cb(len(items))
113
        try:
114
            action_gen.next()
115
        except Exception:
116
            pass
114 117
        for item in items:
115 118
            action(item)
116 119
            action_gen.next()
......
154 157

  
155 158

  
156 159
def main(argv):
160
    _main(argv, config=None)
161

  
157 162

  
163
def _main(argv, config=None):
158 164
    suiteFew = TestSuite()
159 165
    """
160 166
    if len(argv) == 0 or argv[0] == 'pithos':
......
166 172
    if len(argv) == 0 or argv[0] == 'cyclades':
167 173
        from kamaki.clients.tests.cyclades import Cyclades
168 174
        test_method = 'test_%s' % (argv[1] if len(argv) > 1 else '000')
169
        suiteFew.addTest(Cyclades(test_method))
175
        suiteFew.addTest(Cyclades(test_method, config))
170 176
    if len(argv) == 0 or argv[0] == 'image':
171 177
        from kamaki.clients.tests.image import Image
172 178
        test_method = 'test_%s' % (argv[1] if len(argv) > 1 else '000')
173
        suiteFew.addTest(Image(test_method))
179
        suiteFew.addTest(Image(test_method, config))
174 180
    if len(argv) == 0 or argv[0] == 'astakos':
175 181
        from kamaki.clients.tests.astakos import Astakos
176 182
        if len(argv) == 1:
177
            suiteFew.addTest(makeSuite(Astakos))
183
            suiteFew.addTest(makeSuite(Astakos, config))
178 184
        else:
179
            suiteFew.addTest(Astakos('test_' + argv[1]))
185
            suiteFew.addTest(Astakos('test_' + argv[1], config))
180 186

  
181 187
    TextTestRunner(verbosity=2).run(suiteFew)
182 188

  

Also available in: Unified diff