From 6f48cbc4a7f8fa0d7675c4bccbfa51c0f232cb60 Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Mon, 3 Jul 2023 22:40:14 +0200 Subject: [PATCH] Added tests for Gitea URLs. --- src/tests/test_appurl.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tests/test_appurl.py b/src/tests/test_appurl.py index 351bb4e83..996a5a2c3 100644 --- a/src/tests/test_appurl.py +++ b/src/tests/test_appurl.py @@ -69,8 +69,19 @@ def test_repo_url_definition(): assert _is_app_repo_url("git@github.com:YunoHost-Apps/foobar_ynh.git") assert _is_app_repo_url("https://git.super.host/~max/foobar_ynh") + ### Gitea + assert _is_app_repo_url("https://gitea.instance.tld/user/repo_ynh") + assert _is_app_repo_url("https://gitea.instance.tld/user/repo_ynh/src/branch/branch_name") + assert _is_app_repo_url("https://gitea.instance.tld/user/repo_ynh/src/tag/tag_name") + assert _is_app_repo_url("https://gitea.instance.tld/user/repo_ynh/src/commit/abcd1234") + + ### Invalid patterns + + # no schema assert not _is_app_repo_url("github.com/YunoHost-Apps/foobar_ynh") + # http assert not _is_app_repo_url("http://github.com/YunoHost-Apps/foobar_ynh") + # does not end in `_ynh` assert not _is_app_repo_url("https://github.com/YunoHost-Apps/foobar_wat") assert not _is_app_repo_url("https://github.com/YunoHost-Apps/foobar_ynh_wat") assert not _is_app_repo_url("https://github.com/YunoHost-Apps/foobar/tree/testing")