test: assert parse_base_url returns str
This commit is contained in:
parent
b6d7ada521
commit
c7d7adc360
1 changed files with 7 additions and 3 deletions
|
|
@ -9,17 +9,21 @@ class TestParseBaseUrl:
|
|||
|
||||
def test_bitbucket(self) -> None:
|
||||
result = parse_base_url("git@bitbucket.org:byteb4rb1e/foo.git")
|
||||
assert str(result) == "byteb4rb1e"
|
||||
assert result == "byteb4rb1e"
|
||||
|
||||
def test_forgejo_host(self) -> None:
|
||||
result = parse_base_url(
|
||||
"git@git.code.tiararodney.com:h5p-mirror/foo.git"
|
||||
)
|
||||
assert str(result) == "h5p-mirror"
|
||||
assert result == "h5p-mirror"
|
||||
|
||||
def test_github_host(self) -> None:
|
||||
result = parse_base_url("git@github.com:h5p/h5p-multi-choice.git")
|
||||
assert str(result) == "h5p"
|
||||
assert result == "h5p"
|
||||
|
||||
def test_returns_str(self) -> None:
|
||||
result = parse_base_url("git@bitbucket.org:byteb4rb1e/foo.git")
|
||||
assert isinstance(result, str)
|
||||
|
||||
def test_rejects_https_url(self) -> None:
|
||||
with pytest.raises(ValueError):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue