コード例 #1
0
ファイル: test_job_utils.py プロジェクト: yonglehou/sahara
    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)
コード例 #2
0
ファイル: test_job_utils.py プロジェクト: Imperat/sahara
    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)
コード例 #3
0
    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)
コード例 #4
0
ファイル: test_job_utils.py プロジェクト: yonglehou/sahara
    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")
コード例 #5
0
ファイル: test_job_utils.py プロジェクト: yonglehou/sahara
    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)
コード例 #6
0
ファイル: test_job_utils.py プロジェクト: Imperat/sahara
    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")
コード例 #7
0
ファイル: test_job_utils.py プロジェクト: Imperat/sahara
    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)