File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change
1
+ import pytest
2
+
1
3
from pupgui2 .util import *
2
4
3
- from pupgui2 .constants import POSSIBLE_INSTALL_LOCATIONS
5
+ from pupgui2 .constants import POSSIBLE_INSTALL_LOCATIONS , GITLAB_API , GITHUB_API
4
6
from pupgui2 .datastructures import SteamApp , LutrisGame , HeroicGame , Launcher
5
7
6
8
@@ -125,3 +127,20 @@ def test_get_random_game_name() -> None:
125
127
assert get_random_game_name (steam_app ) in names
126
128
assert get_random_game_name (lutris_game ) in names
127
129
assert get_random_game_name (heroic_game ) in names
130
+
131
+
132
+ @pytest .mark .parametrize (
133
+ 'url, is_gitlab_api' , [
134
+ * [pytest .param (api , True , id = api ) for api in GITLAB_API ],
135
+ pytest .param (GITHUB_API , False , id = GITHUB_API )
136
+ ]
137
+ )
138
+ def test_is_gitlab_instance (url : str , is_gitlab_api : bool ) -> None :
139
+
140
+ """
141
+ Test that a given GitLab API URL is detected successfully.
142
+ """
143
+
144
+ result : bool = is_gitlab_instance (url )
145
+
146
+ assert result == is_gitlab_api
You can’t perform that action at this time.
0 commit comments