Пример #1
0
 def test_move_requires_src_and_dst(self):
     script = {
         'foo': 'bar',
         'installer': {},
         'name': 'missing_runner'
     }
     with self.assertRaises(ScriptingError):
         interpreter = ScriptInterpreter(script, None)
         interpreter._get_move_paths({})
Пример #2
0
 def test_script_with_correct_values_is_valid(self):
     script = {
         'runner': 'foo',
         'installer': 'bar',
         'name': 'baz'
     }
     interpreter = ScriptInterpreter(script, None)
     self.assertFalse(interpreter.errors)
     self.assertTrue(interpreter.is_valid())
Пример #3
0
 def test_move_requires_src_and_dst(self):
     script = {
         'foo': 'bar',
         'installer': {},
         'name': 'missing_runner',
         'game_slug': 'missing-runner'
     }
     with self.assertRaises(ScriptingError):
         interpreter = ScriptInterpreter(script, None)
         interpreter._get_move_paths({})
Пример #4
0
 def test_script_with_correct_values_is_valid(self):
     script = {
         'runner': 'foo',
         'installer': 'bar',
         'name': 'baz',
         'game_slug': 'baz',
     }
     interpreter = ScriptInterpreter(script, None)
     self.assertFalse(interpreter.errors)
     self.assertTrue(interpreter.is_valid())
Пример #5
0
 def test_move_requires_src_and_dst(self):
     with NamedTemporaryFile(delete=False) as temp_script:
         temp_script.write("""
                         foo: bar
                         installer: {}
                         name: missing_runner
                         """)
     with self.assertRaises(ScriptingError):
         interpreter = ScriptInterpreter(temp_script.name, None)
         interpreter._get_move_paths({})
Пример #6
0
 def test_script_with_correct_values_is_valid(self):
     script_data = """
     runner: foo
     installer: bar
     name: baz
     """
     with NamedTemporaryFile(delete=False) as temp_script:
         temp_script.write(script_data)
     interpreter = ScriptInterpreter(temp_script.name, None)
     self.assertFalse(interpreter.errors)
     self.assertTrue(interpreter.is_valid())