1
0
Fork 0
megacode/tests/test_registration.py

17 lines
557 B
Python

from urllib.parse import urlparse
def _is_on_kilo(url: str) -> bool:
"""Duplicated here to avoid importing registration (which imports nodriver)."""
hostname = urlparse(url).hostname or ""
return hostname.endswith("kilo.ai")
def test_is_on_kilo():
assert _is_on_kilo("https://app.kilo.ai/profile") is True
assert _is_on_kilo("https://kilo.ai/") is True
assert (
_is_on_kilo("https://accounts.google.com/?redirect=https://app.kilo.ai")
is False
)
assert _is_on_kilo("https://example.com/kilo.ai") is False