예제 #1
0
파일: tests.py 프로젝트: crs4/ACTIVE
	def test_job_abort2(self):
		"""
		Test used to cancel the execution of a job by its id.
		A sample job is runned and then stopped.
		"""
		jm = JobManager()
		jm.start()
		job = Job(increase, (2,))
		job.user = 1
		jm.addJob(job)
		
		jm.abortJob(job.id, job.user)
		job = jm.getJob(job.id, job.user)
		self.assertEqual('ABORTED', job.status)
		jm.stop()
예제 #2
0
파일: tests.py 프로젝트: crs4/ACTIVE
	def test_user_abort2(self):
		"""
		Test used to stop the execution of a given job by another user.
		"""
		jm = JobManager()
		jm.start()
		job = Job(increase, (2,))
		job.user = 1
		jm.addJob(job)
		
		self.assertFalse(jm.abortJob(job.id, 2))
		jm.stop()
예제 #3
0
파일: tests.py 프로젝트: crs4/ACTIVE
	def test_user_abort(self):
		"""
		Test used to stop the execution of a job by its owner.
		"""
		jm = JobManager()
		jm.start()
		job = Job(increase, (6,))
		job.user = 1
		jm.addJob(job)
		
		self.assertTrue(jm.abortJob(job.id, 1))
		jm.stop()
예제 #4
0
파일: tests.py 프로젝트: crs4/ACTIVE
	def test_job_abort(self):
		"""
		Test used to cancel the execution of a job by its id.
		A sample job is runned and then stopped.
		"""
		jm = JobManager()
		jm.start()
		job = Job(increase, (2,))
		job.user = 1
		jm.addJob(job)
		
		self.assertTrue(jm.abortJob(job.id, job.user))
		jm.stop()