Skip to content

Commit

Permalink
Update logging
Browse files Browse the repository at this point in the history
Update tests to include language
  • Loading branch information
NeonDaniel committed May 10, 2024
1 parent 0a9a67d commit 9391e6a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def handle_fallback(self, message: Message):
# Determine what kind of question this is to reply appropriately
for i in ['question', 'who.is', 'why.is']:
for line in self._read_voc_lines(i):
LOG.info(f"Checking for pattern: {line}.*")
LOG.debug(f"Checking for pattern: {line}.*")
if utterance.startswith(line):
LOG.info(f'Fallback type: {i} ({utterance}')
self.speak_dialog(i,
Expand Down
21 changes: 14 additions & 7 deletions test/test_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,29 @@ def neon_must_respond(msg: Message):
self.skill.report_metric = Mock()

message_not_for_neon = Message("test",
{"utterance": "this is long enough"})
{"utterance": "this is long enough",
"lang": "en-us"})
message_too_short = Message("test", {"neon_in_request": True,
"utterance": "short"})
"utterance": "short",
"lang": "en-us"})
# message_neon_must_respond = Message("test",
# {"neon_must_respond": True,
# "utterance": "test search"})
message_question = Message("test", {"neon_in_request": True,
"utterance": "what is rain"})
"utterance": "what is rain",
"lang": "en-us"})
message_who_is = Message("test", {"neon_in_request": True,
"utterance": "who is rain"})
"utterance": "who is rain",
"lang": "en-us"})
message_why_is = Message("test", {"neon_in_request": True,
"utterance": "why is rain"})
"utterance": "why is rain",
"lang": "en-us"})
message_unknown = Message("test", {"neon_in_request": True,
"utterance": "is it raining"})
"utterance": "is it raining",
"lang": "en-us"})
message_transact_client = Message("test", {"neon_in_request": True,
"utterance": "short"},
"utterance": "short",
"lang": "en-us"},
{"client": "mq_api"})
self.assertTrue(self.skill.handle_fallback(message_not_for_neon))
self.skill.speak_dialog.assert_not_called()
Expand Down

0 comments on commit 9391e6a

Please sign in to comment.