Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/cgit/tests/test_lister.py
- This file was added.
# Copyright (C) 2019 the Software Heritage developers | |||||
# License: GNU General Public License version 3, or any later version | |||||
# See top-level LICENSE file for more information | |||||
from urllib.parse import urlparse | |||||
from swh.lister.cgit.lister import find_netloc | |||||
def test_find_netloc(): | |||||
first_url = urlparse('http://git.savannah.gnu.org/cgit/') | |||||
second_url = urlparse('https://cgit.kde.org/') | |||||
assert find_netloc(first_url) == 'http://git.savannah.gnu.org' | |||||
assert find_netloc(second_url) == 'https://cgit.kde.org' |