示例#1
0
 def test_loadgen(self):
     params = Params()
     params.iterations = 1
     params.concurrency = 1
     params.report = 'log.ldjson'
     params.tests = dummy_tests
     worker = Worker(params)
     worker.run_nose(params)
     action_handlers = thread.get_from_thread_store('action_handlers')
     plugin = action_handlers.pop(0)
     self.assertTrue(plugin.started)
     self.assertTrue(plugin.ended)
示例#2
0
    def test_empty_worker(self):
        outfile = tempfile.NamedTemporaryFile()
        print(outfile.name)
        params = Params()
        params.concurrency = 2
        params.iterations = 10
        params.report = outfile.name
        params.tests = []

        worker = Worker(params)
        worker.close = self.get_required_method(
            worker.close)  # check whether close has been called
        try:
            worker.start()
        except:  # assertRaises doesn't catch it
            pass
        self.assertTrue(self.required_method_called)