本文整理汇总了Python中qisrc.git_config.Remote.parse_url方法的典型用法代码示例。如果您正苦于以下问题:Python Remote.parse_url方法的具体用法?Python Remote.parse_url怎么用?Python Remote.parse_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qisrc.git_config.Remote
的用法示例。
在下文中一共展示了Remote.parse_url方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_url_ssh_with_username_with_subfolder
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_ssh_with_username_with_subfolder():
remote = Remote()
remote.url = "ssh://[email protected]/bar/baz"
remote.parse_url()
assert remote.prefix == "ssh://[email protected]/bar/baz/"
assert remote.server == "foo"
assert remote.username == "git"
示例2: test_url_git
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_git():
remote = Remote()
remote.url = "git://example.com"
remote.parse_url()
assert remote.prefix == "git://example.com/"
assert remote.protocol == "git"
assert remote.server == "example.com"
示例3: test_url_filepath
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_filepath():
""" Test Url FilePath """
remote = Remote()
remote.url = "file:///path/to/dir"
remote.parse_url()
assert remote.prefix == "file:///path/to/dir/"
assert remote.protocol == "file"
示例4: test_existing_path
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_existing_path(tmpdir):
""" Test Existing Path """
remote = Remote()
url = tmpdir.mkdir("srv").strpath
remote.url = url
remote.parse_url()
assert remote.prefix == url + os.path.sep
示例5: test_url_ssh_with_username_no_subfolder
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_ssh_with_username_no_subfolder():
""" Test Url Ssh With Username No SubFolder """
remote = Remote()
remote.url = "ssh://[email protected]/"
remote.parse_url()
assert remote.prefix == "ssh://[email protected]/"
assert remote.username == "git"
示例6: test_ssh_url
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_ssh_url():
remote = Remote()
remote.url = "[email protected]"
remote.parse_url()
assert remote.prefix == "[email protected]:"
assert remote.server == "example.com"
assert remote.protocol == "ssh"
assert not remote.port
示例7: test_url_https_trailing_slash
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_https_trailing_slash():
remote = Remote()
remote.url = "https://review.corp/"
remote.parse_url()
assert remote.prefix == "https://review.corp/"
assert remote.server == "review.corp"
assert remote.protocol == "https"
assert not remote.port
示例8: test_url_http
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_http():
remote = Remote()
remote.url = "http://review.corp:8080"
remote.parse_url()
assert remote.prefix == "http://review.corp:8080/"
assert remote.server == "review.corp"
assert remote.port == 8080
assert remote.protocol == "http"
示例9: test_url_win_filepath
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_win_filepath():
if not os.name == "nt":
return
remote = Remote()
remote.url = r"file:///c:\path\to\foo"
remote.parse_url()
assert remote.prefix == r"file:///c:\path\to\foo" + "\\"
assert remote.protocol == "file"
示例10: test_url_win_filepath
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_win_filepath():
""" Test Url Win FilePath """
if not os.name == 'nt':
return
remote = Remote()
remote.url = r"file:///c:\path\to\foo"
remote.parse_url()
assert remote.prefix == r"file:///c:\path\to\foo" + "\\"
assert remote.protocol == "file"
示例11: test_gerrit_url_ssh_subfolder
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_gerrit_url_ssh_subfolder():
with mock.patch("qisrc.review.get_gerrit_username") as get_username:
get_username.return_value = "john"
remote = Remote()
remote.url = "ssh://review.corp:29418/a/subfolder"
remote.parse_url()
assert remote.prefix == "ssh://[email protected]:29418/a/subfolder/"
assert remote.port == 29418
remote.url = "ssh://review.corp:29418/a/subfolder/"
remote.parse_url()
assert remote.prefix == "ssh://[email protected]:29418/a/subfolder/"
示例12: test_url_ssh_no_username
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_ssh_no_username():
with mock.patch("qisrc.review.get_gerrit_username") as get_username:
get_username.return_value = "john"
remote = Remote()
remote.url = "ssh://review.corp:29418"
remote.parse_url()
assert remote.prefix == "ssh://[email protected]:29418/"
assert remote.server == "review.corp"
assert remote.port == 29418
assert remote.protocol == "ssh"
assert remote.username == "john"
示例13: test_url_ssh_with_username_no_subfolder
# 需要导入模块: from qisrc.git_config import Remote [as 别名]
# 或者: from qisrc.git_config.Remote import parse_url [as 别名]
def test_url_ssh_with_username_no_subfolder():
remote = Remote()
remote.url = "ssh://[email protected]/"
remote.parse_url()
assert remote.prefix == "ssh://[email protected]/"
assert remote.username == "git"