From 9391e6a034264be77d60bd6d6b1d13859593ab7b Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 10 May 2024 11:14:35 -0700 Subject: [PATCH] Update logging Update tests to include language --- __init__.py | 2 +- test/test_skill.py | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/__init__.py b/__init__.py index bc190bf..7657266 100644 --- a/__init__.py +++ b/__init__.py @@ -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, diff --git a/test/test_skill.py b/test/test_skill.py index f383255..82e613f 100644 --- a/test/test_skill.py +++ b/test/test_skill.py @@ -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()