當前位置: 首頁>>代碼示例>>Python>>正文


Python MRJobWhereAreYou.parse_output方法代碼示例

本文整理匯總了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))
開發者ID:Affirm,項目名稱:mrjob,代碼行數:28,代碼來源:test_local.py


注:本文中的tests.mr_job_where_are_you.MRJobWhereAreYou.parse_output方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。