本文整理汇总了Python中tests.mr_two_step_job.MRTwoStepJob.get_job_key方法的典型用法代码示例。如果您正苦于以下问题:Python MRTwoStepJob.get_job_key方法的具体用法?Python MRTwoStepJob.get_job_key怎么用?Python MRTwoStepJob.get_job_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.mr_two_step_job.MRTwoStepJob
的用法示例。
在下文中一共展示了MRTwoStepJob.get_job_key方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_owner_and_label_switches
# 需要导入模块: from tests.mr_two_step_job import MRTwoStepJob [as 别名]
# 或者: from tests.mr_two_step_job.MRTwoStepJob import get_job_key [as 别名]
def test_owner_and_label_switches(self):
runner_opts = ['--no-conf', '--owner=ads', '--label=ads_chain']
runner = MRTwoStepJob(runner_opts).make_runner()
match = _JOB_KEY_RE.match(runner.get_job_key())
self.assertEqual(match.group(1), 'ads_chain')
self.assertEqual(match.group(2), 'ads')
示例2: test_auto_everything
# 需要导入模块: from tests.mr_two_step_job import MRTwoStepJob [as 别名]
# 或者: from tests.mr_two_step_job.MRTwoStepJob import get_job_key [as 别名]
def test_auto_everything(self):
test_start = datetime.datetime.utcnow()
os.environ["USER"] = "mcp"
runner = MRTwoStepJob(["--no-conf"]).make_runner()
match = _JOB_KEY_RE.match(runner.get_job_key())
self.assertEqual(match.group(1), "mr_two_step_job")
self.assertEqual(match.group(2), "mcp")
job_start = datetime.datetime.strptime(match.group(3) + match.group(4), "%Y%m%d%H%M%S")
job_start = job_start.replace(microsecond=int(match.group(5)))
self.assertGreaterEqual(job_start, test_start)
self.assertLessEqual(job_start - test_start, datetime.timedelta(seconds=5))
示例3: test_auto_label
# 需要导入模块: from tests.mr_two_step_job import MRTwoStepJob [as 别名]
# 或者: from tests.mr_two_step_job.MRTwoStepJob import get_job_key [as 别名]
def test_auto_label(self):
runner = MRTwoStepJob(['--no-conf']).make_runner()
match = _JOB_KEY_RE.match(runner.get_job_key())
self.assertEqual(match.group(1), 'mr_two_step_job')
self.assertEqual(match.group(2), getpass.getuser())