def _get_current_job_ids(): """ Get a list of the current jobs from the KVS and parse out the numeric job IDs. :returns: list of ints """ jobs = [int(x) for x in kvs.current_jobs()] return sorted(jobs)
def test_current_jobs(self): """ Test the retrieval of the current jobs from the CURRENT_JOBS set. Exercises :py:function:`openquake.kvs.tokens.current_jobs`. """ self.assertFalse(self.client.exists(kvs.tokens.CURRENT_JOBS)) # load some sample jobs into the CURRENT_JOBS set jobs = range(1, 4) for job in jobs: self.client.sadd(kvs.tokens.CURRENT_JOBS, job) current_jobs = kvs.current_jobs() self.assertEqual(jobs, current_jobs)