Skip to content

Commit

Permalink
1.2.1 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Dec 19, 2023
2 parents 2fdbcc4 + 5c2f66c commit ca2f721
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 53 deletions.
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Changelog

## [1.1.1a2](https://github.com/NeonGeckoCom/skill-support_helper/tree/1.1.1a2) (2023-09-05)
## [1.2.1a2](https://github.com/NeonGeckoCom/skill-support_helper/tree/1.2.1a2) (2023-12-19)

[Full Changelog](https://github.com/NeonGeckoCom/skill-support_helper/compare/1.1.1a1...1.1.1a2)
[Full Changelog](https://github.com/NeonGeckoCom/skill-support_helper/compare/1.2.1a1...1.2.1a2)

**Merged pull requests:**

- Update intent for alternate STT/Phrasing [\#70](https://github.com/NeonGeckoCom/skill-support_helper/pull/70) ([NeonDaniel](https://github.com/NeonDaniel))
- Minor intent update and deprecated reference fix [\#72](https://github.com/NeonGeckoCom/skill-support_helper/pull/72) ([NeonDaniel](https://github.com/NeonDaniel))

## [1.1.1a1](https://github.com/NeonGeckoCom/skill-support_helper/tree/1.1.1a1) (2023-08-17)
## [1.2.1a1](https://github.com/NeonGeckoCom/skill-support_helper/tree/1.2.1a1) (2023-12-19)

[Full Changelog](https://github.com/NeonGeckoCom/skill-support_helper/compare/1.1.0...1.1.1a1)
[Full Changelog](https://github.com/NeonGeckoCom/skill-support_helper/compare/1.2.0...1.2.1a1)

**Merged pull requests:**

- Add more diagnostic files [\#69](https://github.com/NeonGeckoCom/skill-support_helper/pull/69) ([NeonDaniel](https://github.com/NeonDaniel))
- Update test case and dependencies [\#73](https://github.com/NeonGeckoCom/skill-support_helper/pull/73) ([NeonDaniel](https://github.com/NeonDaniel))



Expand Down
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from ovos_utils import classproperty
from ovos_utils.log import LOG
from ovos_utils.process_utils import RuntimeRequirements
from ovos_workshop.decorators import intent_file_handler
from ovos_workshop.decorators import intent_handler


class SupportSkill(NeonSkill):
Expand All @@ -73,7 +73,7 @@ def support_email(self) -> str:
"""
return self.settings.get("support_email") or "support@neon.ai"

@intent_file_handler('contact_support.intent')
@intent_handler('contact_support.intent')
def handle_contact_support(self, message: Message):
"""
Handle a user request to contact support
Expand Down
2 changes: 1 addition & 1 deletion locale/en-us/intent/contact_support.intent
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(create|send|generate|i want|i need) (a |)(support|troubleshoot|troubleshooting|problem) (ticket|request|email|report|package)
(create|send|generate|i want|i need) (a |)(support|troubleshoot|troubleshooting|trouble|problem) (ticket|request|email|report|package)
troubleshoot my device
(contact|email) support
report (a|an) (issue|problem|bug)
2 changes: 2 additions & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
neon-minerva[padatious]~=0.1
neon-utils>=1.8.1
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
60 changes: 17 additions & 43 deletions test/test_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,15 @@

import unittest
import os
import json
import yaml

from os import mkdir
from os.path import dirname, join, exists, isfile, getsize
from os.path import dirname, join, isfile, getsize
from mock import Mock
from ovos_utils.messagebus import FakeBus
from ovos_bus_client import Message
from neon_utils.user_utils import get_default_user_config
from mycroft.skills.skill_loader import SkillLoader
from neon_minerva.tests.skill_unit_test_base import SkillTestCase

# Import and initialize installed skill
from skill_support_helper import SupportSkill as Skill


class TestSkill(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)
os.environ["NEON_CONFIG_PATH"] = cls.test_fs

# Override the configuration and fs paths to use the test directory
cls.skill.settings_write_path = cls.test_fs
cls.skill.file_system.path = cls.test_fs
cls.skill._init_settings()
cls.skill.initialize()

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

def test_00_skill_init(self):
# Test any parameters expected to be set in init or initialize methods
Expand Down Expand Up @@ -242,17 +212,21 @@ def test_get_support_info(self):

user_config = get_default_user_config()
user_config["user"]["username"] = "test_user"
test_context = {"klat_data": True, "username": "test_user",
"user_profiles": [user_config]}
test_message = Message("test", {"utterance": "This is a test"},
{"klat_data": True, "username": "test_user",
"user_profiles": [user_config]})
dict(test_context))
# No modules respond
diagnostics = self.skill._get_support_info(test_message)
diag_time = diagnostics["generated_time_utc"]
self.assertIsInstance(datetime.fromisoformat(diag_time), datetime)
pip_info = diagnostics["packages"]
context = diagnostics["message_context"]
for key in test_context:
self.assertEqual(test_context[key], context[key])
self.assertIsInstance(pip_info, str)
self.assertEqual(diagnostics, {"user_profile": user_config,
"message_context": test_message.context,
"message_context": context,
"module_status": {"speech": None,
"audio": None,
"voice": None,
Expand All @@ -270,18 +244,18 @@ def test_get_attachments(self):
real_status = self.skill._check_service_status
self.skill._check_service_status = Mock(return_value={'test': True})

test_message = Message("test", {}, {"content": "something",
"context": True})
original_context = {"content": "something", "context": True}
test_message = Message("test", {}, dict(original_context))
test_profile = {"user": {"username": "test_user"},
"data": {"key": "val"}}

content = self.skill._get_support_info(test_message, test_profile)
self.assertEqual(set(content.keys()),
{'user_profile', 'message_context', 'module_status',
'loaded_skills', 'packages', 'host_device',
'generated_time_utc'})
for key in {'user_profile', 'message_context', 'module_status',
'loaded_skills', 'packages', 'host_device',
'generated_time_utc'}:
self.assertIn(key, content, key)
self.assertEqual(content['user_profile'], test_profile)
self.assertEqual(content['message_context'], test_message.context)
self.assertEqual(content['message_context'], original_context)
self.assertEqual(content['module_status'], {'test': True})
self.assertIsInstance(content['packages'], str)
self.assertIsInstance(content['host_device']['ip'], str)
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

__version__ = "1.2.0"
__version__ = "1.2.1"

0 comments on commit ca2f721

Please sign in to comment.