Skip to content

Commit f50e93a

Browse files
authored
test_steamutil: Implement test for calc_shortcut_app_id (#532)
1 parent d080810 commit f50e93a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_steamutil.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pytest
2+
3+
from pupgui2.steamutil import calc_shortcut_app_id
4+
5+
6+
@pytest.mark.parametrize(
7+
'shortcut_dict, expected_appid', [
8+
pytest.param({ 'name': 'Half-Life 3', 'exe': 'hl3.exe' }, -758629442, id = 'Half-Life 3 (-758629442)'),
9+
pytest.param({ 'name': 'Twenty One', 'exe': '21.exe' }, -416959852, id = 'Twenty One (-416959852)'),
10+
pytest.param({ 'name': 'ProtonUp-Qt', 'exe': 'pupgui2' }, -1763982845, id = 'ProtonUp-Qt (-1763982845)')
11+
]
12+
)
13+
def test_calc_shortcut_app_id(shortcut_dict: dict[str, str], expected_appid: int) -> None:
14+
15+
result: int = calc_shortcut_app_id(shortcut_dict.get('name', ''), shortcut_dict.get('exe', ''))
16+
17+
assert result == expected_appid

0 commit comments

Comments
 (0)