Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ovos-utils 0.1 #45

Merged
merged 4 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions locale/en-us/dialog/on.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
on
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
neon-utils[network]~=1.0
ovos-utils~=0.0.28
ovos-utils~=0.0, >=0.0.28
ovos-bus-client~=0.0.3
1 change: 1 addition & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
neon-minerva[padatious]~=0.1,>=0.1.1a5
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def find_resource_files():
url=f'https://github.com/NeonGeckoCom/{SKILL_NAME}',
license='BSD-3-Clause',
install_requires=get_requirements("requirements.txt"),
extras_require={"test": get_requirements("requirements/test.txt")},
author='Neongecko',
author_email='developers@neon.ai',
long_description=long_description,
Expand Down
2 changes: 1 addition & 1 deletion skill.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"python": [
"neon-utils[network]~=1.0",
"ovos-bus-client~=0.0.3",
"ovos-utils~=0.0.28"
"ovos-utils~=0.0, >=0.0.28"
],
"system": {},
"skill": []
Expand Down
48 changes: 3 additions & 45 deletions test/test_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,55 +25,13 @@
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import os.path
import shutil
import unittest
import pytest
import json

from os import mkdir
from os.path import dirname, join, exists
from mock import Mock
from mycroft_bus_client import Message
from ovos_utils.messagebus import FakeBus

from mycroft.skills.skill_loader import SkillLoader


class TestSkillMethods(unittest.TestCase):

@classmethod
def setUpClass(cls) -> None:
bus = FakeBus()
bus.run_in_thread()
skill_loader = SkillLoader(bus, dirname(dirname(__file__)))
skill_loader.load()
cls.skill = skill_loader.instance

# Define a directory to use for testing
cls.test_fs = join(dirname(__file__), "skill_fs")
if not exists(cls.test_fs):
mkdir(cls.test_fs)

# Override the fs paths to use the test directory
cls.skill.settings_write_path = cls.test_fs
cls.skill.file_system.path = cls.test_fs

# Override speak and speak_dialog to test passed arguments
cls.skill.speak = Mock()
cls.skill.speak_dialog = Mock()

def setUp(self):
self.skill.speak.reset_mock()
self.skill.speak_dialog.reset_mock()
import pytest

def tearDown(self) -> None:
self.skill.bus.remove_all_listeners("neon.wake_words_state")
from neon_minerva.tests.skill_unit_test_base import SkillTestCase

@classmethod
def tearDownClass(cls) -> None:
shutil.rmtree(cls.test_fs)

class TestSkillMethods(SkillTestCase):
def test_00_skill_init(self):
# Test any parameters expected to be set in init or initialize methods
from neon_utils.skills import NeonSkill
Expand Down
Loading