当前位置: 首页>>代码示例>>Python>>正文


Python GitClient._update_submodules方法代码示例

本文整理汇总了Python中vcstools.GitClient._update_submodules方法的典型用法代码示例。如果您正苦于以下问题:Python GitClient._update_submodules方法的具体用法?Python GitClient._update_submodules怎么用?Python GitClient._update_submodules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vcstools.GitClient的用法示例。


在下文中一共展示了GitClient._update_submodules方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_checkout_no_unnecessary_updates_other_branch

# 需要导入模块: from vcstools import GitClient [as 别名]
# 或者: from vcstools.GitClient import _update_submodules [as 别名]
    def test_checkout_no_unnecessary_updates_other_branch(self):
        client = GitClient(self.local_path)
        client.fetches = 0
        client.submodules = 0
        client.fast_forwards = 0

        def ifetch(self):
            self.fetches += 1
            return True

        def iff(self, branch_parent, fetch=True, verbose=False):
            self.fast_forwards += 1
            return True

        def isubm(self, verbose=False, timeout=None):
            self.submodules += 1
            return True
        client._do_fetch = types.MethodType(ifetch, client)
        client._do_fast_forward = types.MethodType(iff, client)
        client._update_submodules = types.MethodType(isubm, client)
        url = self.remote_path
        self.assertFalse(client.path_exists())
        self.assertFalse(client.detect_presence())
        self.assertTrue(client.checkout(url, 'test_branch'))
        self.assertEqual(1, client.submodules)
        self.assertEqual(0, client.fetches)
        self.assertEqual(0, client.fast_forwards)
开发者ID:esteve,项目名称:vcstools,代码行数:29,代码来源:test_git.py


注:本文中的vcstools.GitClient._update_submodules方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。