Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 21, 2023
1 parent e4dd6bc commit ac34af6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
6 changes: 2 additions & 4 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
23 changes: 17 additions & 6 deletions test/unittests/test_skill.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit ac34af6

Please sign in to comment.