Esempio n. 1
0
    def test_load_existing(self, mock_pkg_res):
        """Ensure that plugin objects are returned if found."""
        mock_pkg_res.iter_entry_points.side_effect = mock_iter_entry_points

        # Load a couple of existing modules and verify that they're Ok
        plug = mycroft_plugins.load_plugin('mycroft.plugins.tts', 'dummy')
        self.assertEqual(plug.name, 'dummy')
        plug = mycroft_plugins.load_plugin('mycroft.plugins.stt', 'deepspeech')
        self.assertEqual(plug.name, 'deepspeech')
Esempio n. 2
0
def load_wake_word_plugin(module_name):
    """Wrapper function for loading wake word plugin.

    Args:
        (str) Mycroft wake word module name from config
    """
    return load_plugin('mycroft.plugin.wake_word', module_name)
Esempio n. 3
0
def load_tts_plugin(module_name):
    """Wrapper function for loading tts plugin.

    Args:
        (str) Mycroft tts module name from config
    Returns:
        class: found tts plugin class
    """
    return load_plugin('mycroft.plugin.tts', module_name)
Esempio n. 4
0
def load_stt_plugin(module_name):
    """Wrapper function for loading stt plugin.

    Arguments:
        module_name (str): Mycroft stt module name from config
    Returns:
        class: STT plugin class
    """
    return load_plugin('mycroft.plugin.stt', module_name)
Esempio n. 5
0
 def test_load_nonexisting(self, mock_pkg_res):
     """Ensure that the return value is None when no plugin is found."""
     mock_pkg_res.iter_entry_points.side_effect = mock_iter_entry_points
     plug = mycroft_plugins.load_plugin('mycroft.plugins.tts', 'blah')
     self.assertEqual(plug, None)