def get_job(self, uuid): """ Get the job identified by the uuid :param str uuid: UUID of the job to get :return: the job that matches the uuid :rtype: :py:class:`hoplite.client.RemoteJob` """ return RemoteJob(self.address, self.port, uuid=uuid)
def create_job(self, plugin_name, config): """ Create a job :param str plugin_name: name of the plugin you want to run in the job :param dict config: the configuration dictionary for the job :return: a RemoteJob to access the created job with :rtype: :py:class:`hoplite.client.RemoteJob` """ return RemoteJob( self.address, self.port, name=plugin_name, config=config)
def test_init_job_no_uuid_given_creates_job(self): with HTTMock(post_jobs, get_specific_job_named_something): self.job = RemoteJob("localhost", 5001, "something") self.assertEquals(self.job.uuid, "correctuuid") self.assertEquals(self.job.name, "something")
def setUp(self): with HTTMock(get_specific_job): self.job = RemoteJob("localhost", 5001, "test_plugins.wait_10_seconds", "correctuuid", "api_key")