當前位置: 首頁>>代碼示例>>Python>>正文


Python wstool_cli.WstoolCLI類代碼示例

本文整理匯總了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'), []))
開發者ID:jpgr87,項目名稱:wstool,代碼行數:11,代碼來源:test_diff_functions_svn.py

示例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"]))
開發者ID:cbandera,項目名稱:wstool,代碼行數:12,代碼來源:test_diff_functions_hg.py

示例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'), []))
開發者ID:NikolausDemmel,項目名稱:wstool,代碼行數:12,代碼來源:test_diff_functions_bzr.py

示例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'), []))
開發者ID:jpgr87,項目名稱:wstool,代碼行數:13,代碼來源:test_diff_functions_svn.py

示例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, []))
開發者ID:NikolausDemmel,項目名稱:wstool,代碼行數:13,代碼來源:test_diff_functions_git.py

示例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, []))
開發者ID:cbandera,項目名稱:wstool,代碼行數:14,代碼來源:test_diff_functions_hg.py


注:本文中的wstool.wstool_cli.WstoolCLI類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。