本文整理汇总了Python中spack.stage.Stage.chdir_to_archive方法的典型用法代码示例。如果您正苦于以下问题:Python Stage.chdir_to_archive方法的具体用法?Python Stage.chdir_to_archive怎么用?Python Stage.chdir_to_archive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spack.stage.Stage
的用法示例。
在下文中一共展示了Stage.chdir_to_archive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_restage
# 需要导入模块: from spack.stage import Stage [as 别名]
# 或者: from spack.stage.Stage import chdir_to_archive [as 别名]
def test_restage(self):
stage = Stage(archive_url, name=stage_name)
stage.fetch()
stage.expand_archive()
stage.chdir_to_archive()
self.check_expand_archive(stage, stage_name)
self.check_chdir_to_archive(stage, stage_name)
# Try to make a file in the old archive dir
with closing(open('foobar', 'w')) as file:
file.write("this file is to be destroyed.")
self.assertTrue('foobar' in os.listdir(stage.expanded_archive_path))
# Make sure the file is not there after restage.
stage.restage()
self.check_chdir(stage, stage_name)
self.check_fetch(stage, stage_name)
stage.chdir_to_archive()
self.check_chdir_to_archive(stage, stage_name)
self.assertFalse('foobar' in os.listdir(stage.expanded_archive_path))
stage.destroy()
self.check_destroy(stage, stage_name)
示例2: test_expand_archive
# 需要导入模块: from spack.stage import Stage [as 别名]
# 或者: from spack.stage.Stage import chdir_to_archive [as 别名]
def test_expand_archive(self):
stage = Stage(archive_url, name=stage_name)
stage.fetch()
self.check_setup(stage, stage_name)
self.check_fetch(stage, stage_name)
stage.expand_archive()
stage.chdir_to_archive()
self.check_expand_archive(stage, stage_name)
self.check_chdir_to_archive(stage, stage_name)
stage.destroy()
self.check_destroy(stage, stage_name)