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
parent
baf194c556
commit
8e12aee1dc
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue