本文整理汇总了Python中wstool.wstool_cli.WstoolCLI类的典型用法代码示例。如果您正苦于以下问题:Python WstoolCLI类的具体用法?Python WstoolCLI怎么用?Python WstoolCLI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WstoolCLI类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_wstool_info_svn
def test_wstool_info_svn(self):
cmd = ["wstool", "info", "-t", "ws"]
os.chdir(self.test_root_path)
sys.stdout = output = StringIO()
wstool_main(cmd)
output = output.getvalue()
tokens = _nth_line_split(-2, output)
self.assertEqual(['clone', 'M', 'svn'], tokens[0:3])
cli = WstoolCLI()
self.assertEqual(0, cli.cmd_info(os.path.join(self.test_root_path, 'ws'), []))
示例2: test_wstool_status_hg_untracked
def test_wstool_status_hg_untracked(self):
"""Test untracked status output for hg when run outside workspace"""
cmd = ["wstool", "status", "-t", "ws", "--untracked"]
os.chdir(self.test_root_path)
sys.stdout = output = StringIO()
wstool_main(cmd)
sys.stdout = sys.__stdout__
output = output.getvalue()
self.assertEqual('M clone/modified-fs.txt\nM clone/modified.txt\nA clone/added.txt\nR clone/deleted.txt\n! clone/deleted-fs.txt\n? clone/added-fs.txt\n', output)
cli = WstoolCLI()
self.assertEqual(0, cli.cmd_status(os.path.join(self.test_root_path, 'ws'), ["--untracked"]))
示例3: test_wstool_diff_bzr_outside
def test_wstool_diff_bzr_outside(self):
"""Test diff output for bzr when run outside workspace"""
cmd = ["wstool", "diff", "-t", "ws"]
os.chdir(self.test_root_path)
sys.stdout = output = StringIO()
wstool_main(cmd)
sys.stdout = sys.__stdout__
output = output.getvalue()
self.check_diff_output(output)
cli = WstoolCLI()
self.assertEqual(0, cli.cmd_diff(os.path.join(self.test_root_path, 'ws'), []))
示例4: test_wstool_status_svn_outside
def test_wstool_status_svn_outside(self):
"""Test status output for svn when run outside workspace"""
cmd = ["wstool", "status", "-t", "ws"]
os.chdir(self.test_root_path)
sys.stdout = output = StringIO()
wstool_main(cmd)
sys.stdout = sys.__stdout__
output = output.getvalue()
self.assertStatusListEqual('A clone/added.txt\nD clone/deleted.txt\n! clone/deleted-fs.txt\nM clone/modified.txt\n', output)
cli = WstoolCLI()
self.assertEqual(0, cli.cmd_status(os.path.join(self.test_root_path, 'ws'), []))
示例5: test_wstool_diff_git_inside
def test_wstool_diff_git_inside(self):
"""Test diff output for git when run inside workspace"""
directory = self.test_root_path + "/ws"
cmd = ["wstool", "diff"]
os.chdir(directory)
sys.stdout = output = StringIO()
wstool_main(cmd)
output = output.getvalue()
sys.stdout = sys.__stdout__
self.check_diff_output(output)
cli = WstoolCLI()
self.assertEqual(0, cli.cmd_diff(directory, []))
示例6: test_wstool_status_hg_inside
def test_wstool_status_hg_inside(self):
"""Test status output for hg when run inside workspace"""
directory = self.test_root_path + "/ws"
cmd = ["wstool", "status"]
os.chdir(directory)
sys.stdout = output = StringIO()
wstool_main(cmd)
output = output.getvalue()
sys.stdout = sys.__stdout__
self.assertEqual('M clone/modified-fs.txt\nM clone/modified.txt\nA clone/added.txt\nR clone/deleted.txt\n! clone/deleted-fs.txt\n', output)
cli = WstoolCLI()
self.assertEqual(0, cli.cmd_diff(directory, []))