Skip to content

Commit 54d9cd7

Browse files
committed
Test the logo_url to be not malformed
1 parent 170b1b7 commit 54d9cd7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_metadata.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,16 @@ def test_artifacthub_urls(container: ContainerData) -> None:
558558
# for devel projects we pass it as a query
559559
assert readme_url.path.endswith(".md")
560560
assert "/README" in readme_url.path
561-
assert "//" not in readme_url.path and "//" not in readme_url.path
562-
# TODO(dmllr): add testing for logo-url
561+
assert "//" not in readme_url.path
562+
563+
if "io.artifacthub.package.logo-url" in labels:
564+
logo_url = urllib.parse.urlparse(
565+
labels["io.artifacthub.package.logo-url"]
566+
)
567+
assert logo_url.scheme == "https"
568+
assert logo_url.port is None
569+
assert logo_url.netloc in ("github.com",)
570+
assert "//" not in logo_url.path
563571

564572

565573
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)