Exemple #1
0
 def test_task_sum(self):
     params = [1, 2, 3, 6, 7, 9]
     task_msg = TaskMsg(sum_params, params, dataset=None)
     task_thread = RemoteTaskThread(self.remote_worker, task_msg)
     task_thread.start()
     task_thread.join()
     assert_equals(sum(params), task_thread.result())
Exemple #2
0
    def test_multiply_sum_simple(self):
        list = range(0, 100)
        dataset = DataSet(list, slice_size=4)
        assert_equals(25, len(dataset))

        task_msg = TaskMsg(multiply_sum_simple, params=3, dataset=dataset)
        task_thread = RemoteTaskThread(self.remote_worker, task_msg)
        task_thread.start()
        task_thread.join()
        assert_equals(14850, task_thread.result())
Exemple #3
0
 def test_task_constant(self):
     task_msg = TaskMsg(constant, params=None, dataset=None)
     task_thread = RemoteTaskThread(self.remote_worker, task_msg)
     task_thread.start()
     task_thread.join()
     assert_equals(42, task_thread.result())