test: assert parse_base_url returns str

This commit is contained in:
Tiara Rodney 2026-06-06 16:15:13 +02:00
parent b6d7ada521
commit c7d7adc360
Signed by: tiara
GPG key ID: 5CD8EC1D46106723

View file

@ -9,17 +9,21 @@ class TestParseBaseUrl:
def test_bitbucket(self) -> None: def test_bitbucket(self) -> None:
result = parse_base_url("git@bitbucket.org:byteb4rb1e/foo.git") result = parse_base_url("git@bitbucket.org:byteb4rb1e/foo.git")
assert str(result) == "byteb4rb1e" assert result == "byteb4rb1e"
def test_forgejo_host(self) -> None: def test_forgejo_host(self) -> None:
result = parse_base_url( result = parse_base_url(
"git@git.code.tiararodney.com:h5p-mirror/foo.git" "git@git.code.tiararodney.com:h5p-mirror/foo.git"
) )
assert str(result) == "h5p-mirror" assert result == "h5p-mirror"
def test_github_host(self) -> None: def test_github_host(self) -> None:
result = parse_base_url("git@github.com:h5p/h5p-multi-choice.git") 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: def test_rejects_https_url(self) -> None:
with pytest.raises(ValueError): with pytest.raises(ValueError):