Remove refs to Settings class from skill tester

Skill tester used a "mocked" skill test class overriding some methods.
This is no longer necessary since a normal dict will work just as well.
pull/2482/head
Åke Forslund 2020-02-27 08:05:05 +01:00
parent baf194c556
commit 8e12aee1dc
1 changed files with 2 additions and 26 deletions

View File

@ -32,6 +32,7 @@ To set up a test the test runner can
""" """
from queue import Queue, Empty from queue import Queue, Empty
from copy import copy
import json import json
import time import time
import os import os
@ -42,7 +43,6 @@ from pyee import EventEmitter
from numbers import Number from numbers import Number
from mycroft.messagebus.message import Message from mycroft.messagebus.message import Message
from mycroft.skills.core import MycroftSkill, FallbackSkill from mycroft.skills.core import MycroftSkill, FallbackSkill
from mycroft.skills.settings import Settings
from mycroft.skills.skill_loader import SkillLoader from mycroft.skills.skill_loader import SkillLoader
from mycroft.configuration import Configuration from mycroft.configuration import Configuration
from mycroft.util.log import LOG from mycroft.util.log import LOG
@ -194,28 +194,6 @@ class InterceptEmitter(object):
pass pass
class TestSettings(Settings):
""" Settings instance without saving/loading capability.
"""
def save_skill_settings(self, skill_settings):
pass
def _poll_skill_settings(self):
pass
def _load_settings_meta(self):
return None
def update(self, settings_meta):
pass
def load_skill_settings_from_file(self):
pass
def store(self, force=False):
pass
class MockSkillsLoader(object): class MockSkillsLoader(object):
"""Load a skill and set up emitter """Load a skill and set up emitter
""" """
@ -342,9 +320,7 @@ class SkillTest(object):
def apply_test_settings(self, s, test_case): def apply_test_settings(self, s, test_case):
"""Replace the skills settings with settings from the test_case.""" """Replace the skills settings with settings from the test_case."""
s.settings = TestSettings(s) s.settings = copy(test_case['settings'])
for key in test_case['settings']:
s.settings[key] = test_case['settings'][key]
print(color.YELLOW, 'will run test with custom settings:', print(color.YELLOW, 'will run test with custom settings:',
'\n{}'.format(s.settings), color.RESET) '\n{}'.format(s.settings), color.RESET)