Ejemplo n.º 1
0
    def testJobExecuteOnce(self):
        work_data = [1.111111] * 5
        test_job = Job(0, 0, work_data)

        test_job.execute_next()

        self.assertEqual(int(test_job.work_data[0]), 1112)
Ejemplo n.º 2
0
    def testJobExecutesUntilFinish(self):
        work_data = [1.111111] * 5
        test_job = Job(0, 0, work_data)

        while not test_job.is_finished():
            test_job.execute_next()

        self.assertEqual(int(test_job.work_data[-1]), 1112)
Ejemplo n.º 3
0
    def testJobExecutesOnMoreThanOneElement(self):
        work_data = [1.111111] * 5
        test_job = Job(0, 0, work_data)

        for i in range(2000):
            test_job.execute_next()

        self.assertEqual(int(test_job.work_data[0]), 1112)
        self.assertEqual(int(test_job.work_data[1]), 1112)