Skip to content

Commit 2729724

Browse files
committed
Test the logo_url to be not malformed
1 parent 7707d28 commit 2729724

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tests/test_metadata.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,21 @@ def test_artifacthub_urls(container: ContainerData) -> None:
564564
# for devel projects we pass it as a query
565565
assert readme_url.path.endswith(".md")
566566
assert "/README" in readme_url.path
567-
assert "//" not in readme_url.path and "//" not in readme_url.path
568-
# TODO(dmllr): add testing for logo-url
567+
assert "//" not in readme_url.path
568+
569+
if "io.artifacthub.package.logo-url" in labels:
570+
logo_url = urllib.parse.urlparse(
571+
labels["io.artifacthub.package.logo-url"]
572+
)
573+
assert logo_url.scheme == "https"
574+
assert logo_url.port is None
575+
assert logo_url.netloc in (
576+
"raw.githubusercontent.com",
577+
"opensource.suse.com",
578+
"gcc.gnu.org",
579+
"spack.io",
580+
)
581+
assert "//" not in logo_url.path
569582

570583

571584
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)