Example #1
0
File: tests.py Project: crs4/ACTIVE
	def test_progress(self):
		# verify the correct computational progress
                farm = Farm(Pipe(Seq(identity), Farm(Seq(multiply)), Seq(identity)))
                params = [[1, 2], [3, 4]]
		ex = Executor()
                res = ex.eval(farm, params)
                self.assertEqual(100, ex.get_progress())
Example #2
0
File: tests.py Project: crs4/ACTIVE
        def test_progress(self):
                # check the correct computational progress
		cond = Seq(positive)
                inc  = Seq(increase)
                ide  = Seq(identity)
                if_ = If(cond, inc, ide)
		ex = Executor()
		res = ex.eval(if_, 1)
                self.assertEqual(100, ex.get_progress())
Example #3
0
File: tests.py Project: crs4/ACTIVE
	def test_progress(self):
		# check the correct computational progress
                split_phase = Seq(identity)
                execute_phase = Seq(sumRow)
                merge_phase = Seq(identity)
                my_map = Map(split_phase, execute_phase, merge_phase)
		ex = Executor()
                res = ex.eval(my_map, [[1, 2], [3, 4]])

                self.assertEqual(100, ex.get_progress())
Example #4
0
File: tests.py Project: crs4/ACTIVE
	def test(self):
		"""
		Test the distribution of the percentage of completed stages over a skeleton.
		"""
		js   = JobManager()
		pipe = Pipe(Seq(increase), Seq(increase))
		ext = Executor()
		job = Job(ext, (pipe, 100))
		js.addJob(job)
		js.start()

		#Read the progress variable to check the percentage of completed stages.
		percentage = []	
		while(True):
			val = ext.get_progress()
			if(val not in percentage):
				percentage.append(val)
			if(val == 100):
				break
			sleep(1)

		self.assertEqual(percentage, [0, 50, 100])
		js.stop()	
Example #5
0
File: tests.py Project: crs4/ACTIVE
        def test_progress(self):
		# check the correct computational progress
                pipe = Pipe(Seq(increase), Seq(multiply), Seq(increase))
		ex = Executor()
                res = ex.eval(pipe, 1)
                self.assertEqual(100, ex.get_progress())
Example #6
0
File: tests.py Project: crs4/ACTIVE
	def test_dia(self):
		# check
                seq = Seq(diarization)
		ex = Executor()
                res = ex.eval(seq, "2sec.properties")
                self.assertEqual(100, 100)
Example #7
0
File: tests.py Project: crs4/ACTIVE
	def test_progress(self):
		# check the correct computational progress
                seq = Seq(identity)
		ex = Executor()
                res = ex.eval(seq, 8)
                self.assertEqual(100, ex.get_progress())