def test_submit_validator_passes(self): resources = job_util.JobResources( logging=param_util.LoggingParam('gs://buck/logs', PG)) param_util.validate_submit_args_or_fail(job_resources=resources, all_task_data=self.task_data, provider_name='MYPROVIDER', input_providers=[PG], output_providers=[PG], logging_providers=[PG])
def test_submit_validator_passes(self): job_params = {'inputs': set(), 'outputs': set(), 'mounts': set()} job_resources = job_model.Resources( logging=job_model.LoggingParam('gs://buck/logs', job_model.P_GCS)) param_util.validate_submit_args_or_fail( job_model.JobDescriptor(None, job_params, job_resources, TASK_DESCRIPTORS), provider_name='MYPROVIDER', input_providers=[job_model.P_GCS], output_providers=[job_model.P_GCS], logging_providers=[job_model.P_GCS])
def test_submit_validator_fails(self, name, path, inwl, outwl, logwl): job_params = {'inputs': set(), 'outputs': set(), 'mounts': set()} job_resources = job_model.Resources( logging=job_model.LoggingParam('gs://buck/logs', job_model.P_GCS)) err_expected = 'Unsupported %s path (%s) for provider' % (name, path) with six.assertRaisesRegex(self, ValueError, re.escape(err_expected)): param_util.validate_submit_args_or_fail(job_model.JobDescriptor( None, job_params, job_resources, TASK_DESCRIPTORS), provider_name='MYPROVIDER', input_providers=inwl, output_providers=outwl, logging_providers=logwl)
def test_submit_validator_fails(self, name, path, inwl, outwl, logwl): resources = job_util.JobResources( logging=param_util.LoggingParam('gs://buck/logs', PG)) err_expected = 'Unsupported %s path (%s) for provider' % (name, path) with self.assertRaisesRegexp(ValueError, re.escape(err_expected)): param_util.validate_submit_args_or_fail( job_resources=resources, all_task_data=self.task_data, provider_name='MYPROVIDER', input_providers=inwl, output_providers=outwl, logging_providers=logwl)
def test_submit_validator_passes(self): resources = job_util.JobResources(logging=param_util.LoggingParam( 'gs://buck/logs', param_util.P_GCS)) param_util.validate_submit_args_or_fail( job_resources=resources, job_data={ 'inputs': [], 'outputs': [] }, all_task_data=TASK_DATA, provider_name='MYPROVIDER', input_providers=[param_util.P_GCS], output_providers=[param_util.P_GCS], logging_providers=[param_util.P_GCS])