本文整理汇总了Python中tests.component.ComponentTestGitRepository.get_config方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentTestGitRepository.get_config方法的具体用法?Python ComponentTestGitRepository.get_config怎么用?Python ComponentTestGitRepository.get_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.component.ComponentTestGitRepository
的用法示例。
在下文中一共展示了ComponentTestGitRepository.get_config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_clone_environ
# 需要导入模块: from tests.component import ComponentTestGitRepository [as 别名]
# 或者: from tests.component.ComponentTestGitRepository import get_config [as 别名]
def test_clone_environ(self):
"""Test that environment variables influence git configuration"""
def _dsc(version):
return os.path.join(DEB_TEST_DATA_DIR,
'dsc-native',
'git-buildpackage_%s.dsc' % version)
# Build up somethng we can clone from
dsc = _dsc('0.4.14')
os.environ['DEBFULLNAME'] = 'testing tester'
os.environ['DEBEMAIL'] = '[email protected]'
assert import_dsc(['arg0', dsc]) == 0
repo = ComponentTestGitRepository('git-buildpackage')
self._check_repo_state(repo, 'master', ['master'])
assert len(repo.get_commits()) == 1
got = repo.get_config("user.email")
want = os.environ['DEBEMAIL']
ok_(got == want, "unexpected git config user.email: got %s, want %s" % (got, want))
got = repo.get_config("user.name")
want = os.environ['DEBFULLNAME']
ok_(got == want, "unexpected git config user.name: got %s, want %s" % (got, want))