def test_construct_data_source_url_no_placeholders(self): base_url = "swift://container/input" job_exec_id = six.text_type(uuid.uuid4()) url = job_utils._construct_data_source_url(base_url, job_exec_id) self.assertEqual(base_url, url)
def test_construct_data_source_url_no_placeholders(self): base_url = "swift://container/input" job_exec_id = uuidutils.generate_uuid() url = job_utils._construct_data_source_url(base_url, job_exec_id) self.assertEqual(base_url, url)
def test_construct_data_source_url_randstr_placeholder(self): base_url = "swift://container/input.%RANDSTR(4)%.%RANDSTR(7)%.out" job_exec_id = six.text_type(uuid.uuid4()) url = job_utils._construct_data_source_url(base_url, job_exec_id) self.assertRegex(url, "swift://container/input\.[a-z]{4}\.[a-z]{7}\.out")
def test_construct_data_source_url_job_exec_id_placeholder(self): base_url = "swift://container/input.%JOB_EXEC_ID%.out" job_exec_id = six.text_type(uuid.uuid4()) url = job_utils._construct_data_source_url(base_url, job_exec_id) self.assertEqual("swift://container/input." + job_exec_id + ".out", url)
def test_construct_data_source_url_randstr_placeholder(self): base_url = "swift://container/input.%RANDSTR(4)%.%RANDSTR(7)%.out" job_exec_id = six.text_type(uuid.uuid4()) url = job_utils._construct_data_source_url(base_url, job_exec_id) self.assertRegex( url, "swift://container/input\.[a-z]{4}\.[a-z]{7}\.out")
def test_construct_data_source_url_job_exec_id_placeholder(self): base_url = "swift://container/input.%JOB_EXEC_ID%.out" job_exec_id = six.text_type(uuid.uuid4()) url = job_utils._construct_data_source_url(base_url, job_exec_id) self.assertEqual( "swift://container/input." + job_exec_id + ".out", url)