-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_fsl.py
41 lines (31 loc) · 1.44 KB
/
test_fsl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/python3
# Copyright (C) 2019-2021 Patryk Obara <[email protected]>
# SPDX-License-Identifier: GPL-2.0-or-later
# pylint: disable=missing-docstring
# pylint: disable=wrong-spelling-in-comment
import unittest
import fakesierralauncher as fsl
class TestLauncherParser(unittest.TestCase):
def test_parser_gk1(self):
path = 'tests/files/sierra/gabriel_knight/'
ini = path + 'SierraLauncher.ini'
launcher = fsl.SierraLauncherConfig(ini_file=ini)
self.assertEqual(launcher.name,
'Gabriel Knight - Sins of the Fathers')
self.assertEqual(launcher.games_number(), 1)
game = launcher.games[0]
self.assertEqual(game['path'], path + 'GK1/DOSBOX')
self.assertEqual(game['args'], ['-conf', 'dosboxGK.conf',
'-conf', 'dosboxGK_single.conf',
'-noconsole',
'-c', 'exit'])
def test_parser_kqc(self):
path = 'tests/files/sierra/kings_quest_collection/'
ini = path + 'SierraLauncher.ini'
launcher = fsl.SierraLauncherConfig(ini_file=ini)
self.assertEqual(launcher.name,
"King's Quest Collection(TM)")
self.assertEqual(launcher.games_number(), 7)
self.assertEqual(launcher.games[6]['name'], "King's Quest 7")
if __name__ == '__main__': # pragma: no cover
unittest.main()