Esempio n. 1
0
File: tests.py Progetto: 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()
Esempio n. 2
0
File: tests.py Progetto: 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()
Esempio n. 3
0
File: tests.py Progetto: 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()
Esempio n. 4
0
File: tests.py Progetto: 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()