本文整理汇总了Python中appscale.tools.local_state.LocalState.extract_tgz_app_to_dir方法的典型用法代码示例。如果您正苦于以下问题:Python LocalState.extract_tgz_app_to_dir方法的具体用法?Python LocalState.extract_tgz_app_to_dir怎么用?Python LocalState.extract_tgz_app_to_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appscale.tools.local_state.LocalState
的用法示例。
在下文中一共展示了LocalState.extract_tgz_app_to_dir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_extract_tgz_app_to_dir
# 需要导入模块: from appscale.tools.local_state import LocalState [as 别名]
# 或者: from appscale.tools.local_state.LocalState import extract_tgz_app_to_dir [as 别名]
def test_extract_tgz_app_to_dir(self):
flexmock(os)
os.should_receive('mkdir').and_return()
flexmock(os.path)
os.path.should_receive('abspath').with_args('relative/app.tar.gz') \
.and_return('/tmp/relative/app.tar.gz')
flexmock(LocalState)
LocalState.should_receive('shell') \
.with_args(re.compile("tar zxvf '/tmp/relative/app.tar.gz'"), False) \
.and_return()
os.should_receive('listdir').and_return(['one_folder'])
os.path.should_receive('isdir').with_args(re.compile('one_folder')) \
.and_return(True)
location = LocalState.extract_tgz_app_to_dir('relative/app.tar.gz', False)
self.assertEquals(True, 'one_folder' in location)