def test_ramp_up1(self): outfile = tempfile.NamedTemporaryFile() print(outfile.name) params1 = Params() params1.concurrency = 50 params1.report = outfile.name params1.tests = dummy_tests params1.ramp_up = 60 params1.steps = 5 params1.worker_count = 2 params1.worker_index = 0 worker1 = Worker(params1) res1 = [x.delay for x in worker1._get_thread_params()] print(res1) self.assertEquals(params1.concurrency, len(res1)) params2 = copy.deepcopy(params1) params2.worker_index = 1 worker2 = Worker(params2) res2 = [x.delay for x in worker2._get_thread_params()] print(res2) self.assertEquals(params2.concurrency, len(res2)) print(sorted(res1 + res2))
def test_ramp_up2(self): outfile = tempfile.NamedTemporaryFile() params1 = Params() params1.concurrency = 50 params1.report = outfile.name params1.tests = dummy_tests params1.ramp_up = 60 params1.worker_count = 1 params1.worker_index = 0 worker1 = Worker(params1) res1 = [x.delay for x in worker1._get_thread_params()] self.assertEquals(params1.concurrency, len(res1))