本文整理汇总了Python中app.project_type.git.Git.slave_param_overrides方法的典型用法代码示例。如果您正苦于以下问题:Python Git.slave_param_overrides方法的具体用法?Python Git.slave_param_overrides怎么用?Python Git.slave_param_overrides使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.project_type.git.Git
的用法示例。
在下文中一共展示了Git.slave_param_overrides方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_slave_param_overrides_when_get_project_from_master_is_disabled
# 需要导入模块: from app.project_type.git import Git [as 别名]
# 或者: from app.project_type.git.Git import slave_param_overrides [as 别名]
def test_slave_param_overrides_when_get_project_from_master_is_disabled(self):
Configuration['get_project_from_master'] = False
git = Git(url='http://original-user-specified-url.test/repo-path/repo-name')
actual_overrides = git.slave_param_overrides()
self.assertFalse(
'url' in actual_overrides,
'"url" should not be in the params to override when "get_project_from_master" is False',
)
self.assertFalse(
'branch' in actual_overrides,
'"branch" should not be in the params to override when "get_project_from_master" is False',
)
示例2: test_slave_param_overrides_returns_expected
# 需要导入模块: from app.project_type.git import Git [as 别名]
# 或者: from app.project_type.git.Git import slave_param_overrides [as 别名]
def test_slave_param_overrides_returns_expected(self):
self._patch_popen({
'git rev-parse FETCH_HEAD': _FakePopenResult(stdout='deadbee123\n')
})
Configuration['repo_directory'] = '/repo-directory'
git = Git(url='http://original-user-specified-url.test/repo-path/repo-name')
git.fetch_project()
actual_overrides = git.slave_param_overrides()
expected_overrides = {
'url': 'ssh://fake_hostname/repodirectory/originaluserspecifiedurl.test/repopath/reponame',
'branch': 'refs/clusterrunner/deadbee123',
}
self.assertEqual(expected_overrides, actual_overrides, 'Slave param overrides from Git object should match'
'expected.')