diff --git a/ovos_workshop/skills/ovos.py b/ovos_workshop/skills/ovos.py index 4117c62..7dca9a0 100644 --- a/ovos_workshop/skills/ovos.py +++ b/ovos_workshop/skills/ovos.py @@ -152,10 +152,8 @@ def __acknowledge_classic(): require a verbal response. This is intended to provide simple feedback to the user that their request was handled successfully. """ - # DEPRECATED - note that this is a staticmethod and uses the old endpoint - # the OVOSSkill class does things properly - from ovos_utils.sound import play_acknowledge_sound - return play_acknowledge_sound() + # use BaseSkill method, self.play_audio does not exist + return super().acknowledge() @backwards_compat(classic_core=__acknowledge_classic) def acknowledge(self): diff --git a/test/unittests/test_skill.py b/test/unittests/test_skill.py index c1f2523..df47998 100644 --- a/test/unittests/test_skill.py +++ b/test/unittests/test_skill.py @@ -1,15 +1,26 @@ import json import unittest +from os.path import dirname from unittest.mock import Mock -from ovos_bus_client import Message - -from ovos_workshop.skills.ovos import OVOSSkill -from ovos_workshop.skills.mycroft_skill import MycroftSkill, is_classic_core from mycroft.skills import MycroftSkill as CoreSkill +from ovos_bus_client import Message from ovos_utils.messagebus import FakeBus -from os.path import dirname from ovos_workshop.skill_launcher import SkillLoader +from ovos_workshop.skills.mycroft_skill import MycroftSkill +from ovos_workshop.skills.ovos import OVOSSkill + + +def is_classic_core(): + try: + from mycroft.version import OVOS_VERSION_STR + return False + except: + try: + import mycroft + return True + except: + return False class LegacySkill(CoreSkill): @@ -102,7 +113,7 @@ def test_skill_id(self): # if running in ovos-core every message will have the skill_id in context for msg in self.bus.emitted_msgs: - if msg["type"] == 'mycroft.skills.loaded': # emitted by SkillLoader, not by skill + if msg["type"] == 'mycroft.skills.loaded': # emitted by SkillLoader, not by skill continue self.assertEqual(msg["context"]["skill_id"], "abort.test")