本文整理汇总了Python中pypeline.atomiccmd.command.AtomicCmd.commit方法的典型用法代码示例。如果您正苦于以下问题:Python AtomicCmd.commit方法的具体用法?Python AtomicCmd.commit怎么用?Python AtomicCmd.commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypeline.atomiccmd.command.AtomicCmd
的用法示例。
在下文中一共展示了AtomicCmd.commit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_atomiccmd__commit_temp_only
# 需要导入模块: from pypeline.atomiccmd.command import AtomicCmd [as 别名]
# 或者: from pypeline.atomiccmd.command.AtomicCmd import commit [as 别名]
def test_atomiccmd__commit_temp_only(temp_folder):
cmd = AtomicCmd(("echo", "foo"),
TEMP_OUT_STDOUT = "bar.txt")
cmd.run(temp_folder)
assert_equal(cmd.join(), [0])
assert os.path.exists(os.path.join(temp_folder, "bar.txt"))
cmd.commit(temp_folder)
assert_equal(os.listdir(temp_folder), [])
示例2: _do_test_atomiccmd__stdout
# 需要导入模块: from pypeline.atomiccmd.command import AtomicCmd [as 别名]
# 或者: from pypeline.atomiccmd.command.AtomicCmd import commit [as 别名]
def _do_test_atomiccmd__stdout(temp_folder, kwargs):
cmd = AtomicCmd(("echo", "-n", "foo"), **kwargs)
assert cmd.stdout is None
cmd.run(temp_folder)
assert isinstance(cmd.stdout, types.FileType), cmd.stdout
assert_equal(cmd.stdout.read(), "foo")
cmd.join()
cmd.commit(temp_folder)
assert cmd.stdout is None
示例3: test_atomiccmd__commit_temp_out
# 需要导入模块: from pypeline.atomiccmd.command import AtomicCmd [as 别名]
# 或者: from pypeline.atomiccmd.command.AtomicCmd import commit [as 别名]
def test_atomiccmd__commit_temp_out(temp_folder):
dest, temp = _setup_for_commit(temp_folder, create_cmd = False)
cmd = AtomicCmd(("echo", "foo"),
OUT_STDOUT = os.path.join(dest, "foo.txt"),
TEMP_OUT_FOO = "bar.txt")
cmd.run(temp)
assert_equal(cmd.join(), [0])
set_file_contents(os.path.join(temp, "bar.txt"), "1 2 3")
cmd.commit(temp)
assert_equal(os.listdir(temp), [])
assert_equal(os.listdir(dest), ["foo.txt"])
示例4: commit
# 需要导入模块: from pypeline.atomiccmd.command import AtomicCmd [as 别名]
# 或者: from pypeline.atomiccmd.command.AtomicCmd import commit [as 别名]
def commit(self, temp):
AtomicCmd.commit(self, temp)
os.remove(os.path.join(destination, "foo.txt"))