diff --git a/platypush/message/event/assistant/__init__.py b/platypush/message/event/assistant/__init__.py index 2047c1a62..1ca2049e6 100644 --- a/platypush/message/event/assistant/__init__.py +++ b/platypush/message/event/assistant/__init__.py @@ -17,15 +17,12 @@ class AssistantEvent(Event): if assistant: self._assistant = assistant else: - self._assistant = get_backend('assistant.google') - - if not self._assistant: - self._assistant = get_plugin('assistant.google.pushtotalk') - - if not self._assistant: - self.logger.warning( - 'Assistant plugin/backend not configured/initialized' - ) + try: + self._assistant = get_backend('assistant.google') + if not self._assistant: + self._assistant = get_plugin('assistant.google.pushtotalk') + except Exception as e: + self.logger.debug('Could not initialize the assistant component: %s', e) self._assistant = None diff --git a/tests/test_event_parse.py b/tests/test_event_parse.py index dfb45e449..443336f79 100644 --- a/tests/test_event_parse.py +++ b/tests/test_event_parse.py @@ -82,7 +82,7 @@ def test_speech_recognized_event_parse(): assert 'answer' in result.parsed_args assert result.parsed_args['answer'] == '42' - event = PingEvent(phrase="what is not the answer? 43") + event = SpeechRecognizedEvent(phrase="what is not the answer? 43") result = event.matches_condition(condition) assert not result.is_match