Esempio n. 1
0
def test_RepoTask_get_remote_url(mock_subprocess_Popen):
    task = ghcloneall.RepoTask({}, None, None, None)
    mock_subprocess_Popen.stdout = b'https://github.com/test_user/xyzzy\n'
    assert task.get_remote_url('xyzzy') == (
        'https://github.com/test_user/xyzzy')
Esempio n. 2
0
def test_RepoTask_branch_name():
    task = ghcloneall.RepoTask({}, None, None, None)
    assert task.branch_name('refs/heads/master') == 'master'
    assert task.branch_name('refs/tags/v0.15') == 'tags/v0.15'
Esempio n. 3
0
def test_RepoTask_get_current_branch(mock_subprocess_Popen):
    task = ghcloneall.RepoTask({}, None, None, None)
    mock_subprocess_Popen.stdout = b'refs/heads/master\n'
    assert task.get_current_branch('xyzzy') == 'master'