本文整理汇总了Python中tests.mr_job_where_are_you.MRJobWhereAreYou.parse_output方法的典型用法代码示例。如果您正苦于以下问题:Python MRJobWhereAreYou.parse_output方法的具体用法?Python MRJobWhereAreYou.parse_output怎么用?Python MRJobWhereAreYou.parse_output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.mr_job_where_are_you.MRJobWhereAreYou
的用法示例。
在下文中一共展示了MRJobWhereAreYou.parse_output方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_can_turn_off_bootstrap_mrjob
# 需要导入模块: from tests.mr_job_where_are_you import MRJobWhereAreYou [as 别名]
# 或者: from tests.mr_job_where_are_you.MRJobWhereAreYou import parse_output [as 别名]
def test_can_turn_off_bootstrap_mrjob(self):
with mrjob_conf_patcher(
{'runners': {'local': {'bootstrap_mrjob': False}}}):
mr_job = MRJobWhereAreYou(['-r', 'local'])
mr_job.sandbox()
with mr_job.make_runner() as runner:
# sanity check
self.assertEqual(runner._opts['bootstrap_mrjob'], False)
local_tmp_dir = os.path.realpath(runner._get_local_tmp_dir())
try:
runner.run()
except StepFailedException:
# this is what happens when mrjob isn't installed elsewhere
return
# however, if mrjob is installed, we need to verify that
# we're using the installed version and not a bootstrapped copy
output = list(mr_job.parse_output(runner.cat_output()))
self.assertEqual(len(output), 1)
# script should not load mrjob from local_tmp_dir
_, script_mrjob_dir = output[0]
self.assertFalse(script_mrjob_dir.startswith(local_tmp_dir))