mirror of
https://github.com/lutris/lutris
synced 2024-11-02 14:42:13 +00:00
24 lines
877 B
Python
24 lines
877 B
Python
|
from unittest import TestCase
|
||
|
|
||
|
from lutris.util.resources import parse_installer_url
|
||
|
|
||
|
|
||
|
class TestInstallerUrls(TestCase):
|
||
|
def test_legacy_url(self):
|
||
|
result = parse_installer_url("lutris:quake")
|
||
|
self.assertEqual(result['game_slug'], 'quake')
|
||
|
self.assertEqual(result['revision'], None)
|
||
|
self.assertEqual(result['action'], None)
|
||
|
|
||
|
def test_action_rungameid(self):
|
||
|
result = parse_installer_url("lutris:rungameid/123")
|
||
|
self.assertEqual(result['game_slug'], '123')
|
||
|
self.assertEqual(result['revision'], None)
|
||
|
self.assertEqual(result['action'], 'rungameid')
|
||
|
|
||
|
def test_action_rungame(self):
|
||
|
result = parse_installer_url("lutris:rungame/quake")
|
||
|
self.assertEqual(result['game_slug'], 'quake')
|
||
|
self.assertEqual(result['revision'], None)
|
||
|
self.assertEqual(result['action'], 'rungame')
|