本文整理汇总了Python中mrjob.emr.EMRJobRunner._s3_ls方法的典型用法代码示例。如果您正苦于以下问题:Python EMRJobRunner._s3_ls方法的具体用法?Python EMRJobRunner._s3_ls怎么用?Python EMRJobRunner._s3_ls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mrjob.emr.EMRJobRunner
的用法示例。
在下文中一共展示了EMRJobRunner._s3_ls方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_s3_ls
# 需要导入模块: from mrjob.emr import EMRJobRunner [as 别名]
# 或者: from mrjob.emr.EMRJobRunner import _s3_ls [as 别名]
def test_s3_ls(self):
runner = EMRJobRunner(s3_scratch_uri='s3://walrus/tmp',
conf_path=False)
self.add_mock_s3_data({'walrus': {'one': '', 'two': '', 'three': ''}})
assert_equal(set(runner._s3_ls('s3://walrus/')),
set(['s3://walrus/one',
's3://walrus/two',
's3://walrus/three',]))
assert_equal(set(runner._s3_ls('s3://walrus/t')),
set(['s3://walrus/two',
's3://walrus/three',]))
assert_equal(set(runner._s3_ls('s3://walrus/t/')),
set([]))
# if we ask for a nonexistent bucket, we should get some sort
# of exception (in practice, buckets with random names will
# probably be owned by other people, and we'll get some sort
# of permissions error)
assert_raises(Exception, set, runner._s3_ls('s3://lolcat/'))