From e667c3a6c3d4e4c39697d6b6318b32e86fa2611c Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Mon, 1 May 2017 02:17:33 -0700 Subject: [PATCH] Update tests --- tests/test_installer.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/test_installer.py b/tests/test_installer.py index 7cbf1a1da..bc66867fc 100644 --- a/tests/test_installer.py +++ b/tests/test_installer.py @@ -2,6 +2,17 @@ from unittest import TestCase from lutris.installer.interpreter import ScriptInterpreter from lutris.installer.errors import ScriptingError +TEST_INSTALLER = { + 'script': { + 'game': 'test' + }, + 'version': 'test', + 'game_slug': 'test', + 'name': 'test', + 'slug': 'test', + 'runner': 'linux' +} + class MockInterpreter(ScriptInterpreter): """A script interpreter mock.""" @@ -38,14 +49,14 @@ class TestScriptInterpreter(TestCase): interpreter._get_move_paths({}) def test_get_command_returns_a_method(self): - interpreter = MockInterpreter({'script': []}, None) + interpreter = MockInterpreter(TEST_INSTALLER, None) command, params = interpreter._map_command({'move': 'whatever'}) self.assertIn("bound method CommandsMixin.move", str(command)) self.assertEqual(params, "whatever") def test_get_command_doesnt_return_private_methods(self): """ """ - interpreter = MockInterpreter({'script': []}, None) + interpreter = MockInterpreter(TEST_INSTALLER, None) with self.assertRaises(ScriptingError) as ex: command, params = interpreter._map_command( {'_substitute': 'foo'}