Exemple #1
0
def test_github_vcs_info(monkeypatch):
    monkeypatch.setattr(vcs, 'locate_git', lambda: '.')
    monkeypatch.setattr(
        Repo, 'remotes',
        {'origin': MockOrigin('[email protected]:ceasaro/about_py.git')})
    info = get_vcs_info()
    assert info.name == 'Git'
    assert info.origin_url == 'https://github.com/ceasaro/about_py'
Exemple #2
0
def test_bitbucket_vcs_info(monkeypatch):
    monkeypatch.setattr(vcs, 'locate_git', lambda: '.')
    monkeypatch.setattr(
        Repo, 'remotes',
        {'origin': MockOrigin('[email protected]:ceasaro/scripts.git')})
    info = get_vcs_info()
    assert info.name == 'Git'
    assert info.origin_url == 'https://bitbucket.org/ceasaro/scripts'
Exemple #3
0
 def get_vcs(self):
     try:
         return get_vcs_info()
     except AboutPyException as e:
         LOG.warn('no vcs detected. cause: {}'.format(e.message))
         return {}
Exemple #4
0
def test_no_vcs(monkeypatch):
    monkeypatch.setattr(vcs, 'locate_git', lambda: None)
    info = get_vcs_info()
    assert info.is_empty()