示例#1
0
def test_get_remote_repo_url_should_work_with_user():
    with patch.object(M, 'getoutput') as mock_getoutput:
        mock_getoutput.return_value = """\
origin  http://[email protected]/testrepo.git (fetch)
origin  http://[email protected]/testrepo.git (push)
upstream    http://code.dapps.douban.com/testrepo.git (fetch)
upstream    http://code.dapps.douban.com/testrepo.git (push)
"""

        repourl = M.get_remote_repo_url('origin')
    eq_(repourl, 'http://[email protected]/testrepo')
示例#2
0
def test_get_remote_repo_url_should_work_with_user():
    with patch.object(M, 'getoutput') as mock_getoutput:
        mock_getoutput.return_value = """\
origin  http://[email protected]/testrepo.git (fetch)
origin  http://[email protected]/testrepo.git (push)
upstream    http://code.dapps.douban.com/testrepo.git (fetch)
upstream    http://code.dapps.douban.com/testrepo.git (push)
"""

        repourl = M.get_remote_repo_url('origin')
    eq_(repourl, 'http://[email protected]/testrepo')
示例#3
0
def test_get_remote_repo_url_should_work():
    with patch.object(M, "getoutput") as mock_getoutput:
        mock_getoutput.return_value = """\
origin  http://code.dapps.douban.com/testrepo.git (fetch)
origin  http://code.dapps.douban.com/testrepo.git (push)
upstream    http://code.dapps.douban.com/testrepo.git (fetch)
upstream    http://code.dapps.douban.com/testrepo.git (push)
"""

        repourl = M.get_remote_repo_url("origin")
    eq_(repourl, "http://code.dapps.douban.com/testrepo")