files: # Copyright 2019 Mycroft AI Inc.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #    http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  #
  """Decorators for use with MycroftSkill methods"""
  
  
  def intent_handler(intent_parser):
      """Decorator for adding a method as an intent handler."""
  
      def real_decorator(func):
          # Store the intent_parser inside the function
          # This will be used later to call register_intent
          if not hasattr(func, 'intents'):
              func.intents = []
          func.intents.append(intent_parser)
          return func
  
      return real_decorator
  
  
  def intent_file_handler(intent_file):
      """Decorator for adding a method as an intent file handler.
  
      This decorator is deprecated, use intent_handler for the same effect.
      """
  
      def real_decorator(func):
          # Store the intent_file inside the function
          # This will be used later to call register_intent_file
          if not hasattr(func, 'intent_files'):
              func.intent_files = []
          func.intent_files.append(intent_file)
          return func
  
      return real_decorator
  
  
  def resting_screen_handler(name):
      """Decorator for adding a method as an resting screen handler.
  
      If selected will be shown on screen when device enters idle mode.
      """
  
      def real_decorator(func):
          # Store the resting information inside the function
          # This will be used later in register_resting_screen
          if not hasattr(func, 'resting_handler'):
              func.resting_handler = name
          return func
  
      return real_decorator
  
  
  [... the rest is omitted ...]
files: mycroft/skills/mycroft_skill/decorators.py
files: # Copyright 2019 Mycroft AI Inc.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #    http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  #
  """Decorators for use with MycroftSkill methods"""
  
  
  def intent_handler(intent_parser):
      """Decorator for adding a method as an intent handler."""
  
      def real_decorator(func):
          # Store the intent_parser inside the function
          # This will be used later to call register_intent
          if not hasattr(func, 'intents'):
              func.intents = []
          func.intents.append(intent_parser)
          return func
  
      return real_decorator
  
  
  def intent_file_handler(intent_file):
      """Decorator for adding a method as an intent file handler."""
  
      def real_decorator(func):
          # Store the intent_file inside the function
          # This will be used later to call register_intent_file
          if not hasattr(func, 'intent_files'):
              func.intent_files = []
          func.intent_files.append(intent_file)
          return func
  
      return real_decorator
  
  
  def resting_screen_handler(name):
      """Decorator for adding a method as an resting screen handler.
  
      If selected will be shown on screen when device enters idle mode.
      """
  
      def real_decorator(func):
          # Store the resting information inside the function
          # This will be used later in register_resting_screen
          if not hasattr(func, 'resting_handler'):
              func.resting_handler = name
          return func
  
      return real_decorator
  
  
  [... the rest is omitted ...]
files: mycroft/skills/mycroft_skill/decorators.py
files: # Copyright 2019 Mycroft AI Inc.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #    http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  #
  """ Collection of functions relating to the implementation of mycroft skills.
  """
  import sys
  import re
  import traceback
  import inspect
  from inspect import ismethod, signature
  import collections
  import csv
  from itertools import chain
  from adapt.intent import Intent, IntentBuilder
  from os import walk
  from os.path import join, abspath, dirname, basename, exists
  from threading import Event, Timer
  
  from mycroft import dialog
  from mycroft.api import DeviceApi
  from mycroft.audio import wait_while_speaking
  from mycroft.enclosure.api import EnclosureAPI
  from mycroft.enclosure.gui import SkillGUI
  from mycroft.configuration import Configuration
  from mycroft.dialog import DialogLoader
  from mycroft.filesystem import FileSystemAccess
  from mycroft.messagebus.message import Message
  from mycroft.metrics import report_metric, report_timing, Stopwatch
  from mycroft.util import (camel_case_split,
                            resolve_resource_file,
                            play_audio_file)
  from mycroft.util.log import LOG
  
  from ..settings import SkillSettings
  from ..skill_data import (load_vocabulary, load_regex, to_alnum,
                            munge_regex, munge_intent_parser, read_vocab_file)
  from ..event_scheduler import EventSchedulerInterface
  
  
  def simple_trace(stack_trace):
      """Generate a simplified traceback.
  
      Arguments:
          stack_trace: Stack trace to simplify
  
      Returns: (str) Simplified stack trace.
      """
      stack_trace = stack_trace[:-1]
      tb = "Traceback:\n"
      for line in stack_trace:
          if line.strip():
              tb += line
      return tb
  
  
  def get_non_properties(obj):
      """Get attibutes that are not properties from object.
  
      Will return members of object class along with bases down to MycroftSkill.
  
      Arguments:
          obj:    object to scan
  
      Returns:
          Set of attributes that are not a property.
      """
  
      def check_class(cls):
          """Find all non-properties in a class."""
          # Current class
          d = cls.__dict__
          np = [k for k in d if not isinstance(d[k], property)]
          # Recurse through base classes excluding MycroftSkill and object
          for b in [b for b in cls.__bases__ if b not in (object, MycroftSkill)]:
              np += check_class(b)
          return np
  
      return set(check_class(obj.__class__))
  
  
  def dig_for_message():
      """Dig Through the stack for message."""
      stack = inspect.stack()
      # Limit search to 10 frames back
      stack = stack if len(stack) < 10 else stack[:10]
      local_vars = [frame[0].f_locals for frame in stack]
      for l in local_vars:
          if 'message' in l and isinstance(l['message'], Message):
              return l['message']
  
  
  def unmunge_message(message, skill_id):
      """Restore message keywords by removing the Letterified skill ID.
  
      Arguments:
          message (Message): Intent result message
          skill_id (str): skill identifier
  
      Returns:
          Message without clear keywords
      """
      if isinstance(message, Message) and isinstance(message.data, dict):
          skill_id = to_alnum(skill_id)
          for key in list(message.data.keys()):
              if key.startswith(skill_id):
                  # replace the munged key with the real one
                  new_key = key[len(skill_id):]
                  message.data[new_key] = message.data.pop(key)
  
      return message
  
  
  def get_handler_name(handler):
      """Name (including class if available) of handler function.
  
      Arguments:
          handler (function): Function to be named
  
      Returns:
          string: handler name as string
      """
      if '__self__' in dir(handler) and 'name' in dir(handler.__self__):
          return handler.__self__.name + '.' + handler.__name__
      else:
          return handler.__name__
  
  
  class MycroftSkill:
      """Base class for mycroft skills providing common behaviour and parameters
      to all Skill implementations.
  
      For information on how to get started with creating mycroft skills see
      https://https://mycroft.ai/documentation/skills/introduction-developing-skills/
  
      Arguments:
          name (str): skill name
          bus (MycroftWebsocketClient): Optional bus connection
          use_settings (bool): Set to false to not use skill settings at all
      """
      def __init__(self, name=None, bus=None, use_settings=True):
          self.name = name or self.__class__.__name__
          self.resting_name = None
          # Get directory of skill
          self._dir = dirname(abspath(sys.modules[self.__module__].__file__))
          if use_settings:
              self.settings = SkillSettings(self._dir, self.name)
          else:
              self.settings = None
  
          self.gui = SkillGUI(self)
  
          self._bus = None
          self._enclosure = None
          self.bind(bus)
          #: Mycroft global configuration. (dict)
          self.config_core = Configuration.get()
          # TODO: 19.08 - Remove
          self._config = self.config_core.get(self.name) or {}
          self.dialog_renderer = None
          self.root_dir = self._dir  #: skill root directory
  
          #: Filesystem access to skill specific folder.
          #: See mycroft.filesystem for details.
          self.file_system = FileSystemAccess(join('skills', self.name))
          self.registered
  
  [... the rest is omitted ...]
files: mycroft/skills/mycroft_skill/mycroft_skill.py
files: # Copyright 2019 Mycroft AI Inc.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #    http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  #
  """ Collection of functions relating to the implementation of mycroft skills.
  """
  import sys
  import re
  import traceback
  import inspect
  from inspect import ismethod, signature
  import collections
  import csv
  from itertools import chain
  from adapt.intent import Intent, IntentBuilder
  from os import walk
  from os.path import join, abspath, dirname, basename, exists
  from threading import Event, Timer
  
  from mycroft import dialog
  from mycroft.api import DeviceApi
  from mycroft.audio import wait_while_speaking
  from mycroft.enclosure.api import EnclosureAPI
  from mycroft.enclosure.gui import SkillGUI
  from mycroft.configuration import Configuration
  from mycroft.dialog import DialogLoader
  from mycroft.filesystem import FileSystemAccess
  from mycroft.messagebus.message import Message
  from mycroft.metrics import report_metric, report_timing, Stopwatch
  from mycroft.util import (camel_case_split,
                            resolve_resource_file,
                            play_audio_file)
  from mycroft.util.log import LOG
  
  from ..settings import SkillSettings
  from ..skill_data import (load_vocabulary, load_regex, to_alnum,
                            munge_regex, munge_intent_parser, read_vocab_file)
  from ..event_scheduler import EventSchedulerInterface
  
  
  def simple_trace(stack_trace):
      """Generate a simplified traceback.
  
      Arguments:
          stack_trace: Stack trace to simplify
  
      Returns: (str) Simplified stack trace.
      """
      stack_trace = stack_trace[:-1]
      tb = "Traceback:\n"
      for line in stack_trace:
          if line.strip():
              tb += line
      return tb
  
  
  def get_non_properties(obj):
      """Get attibutes that are not properties from object.
  
      Will return members of object class along with bases down to MycroftSkill.
  
      Arguments:
          obj:    object to scan
  
      Returns:
          Set of attributes that are not a property.
      """
  
      def check_class(cls):
          """Find all non-properties in a class."""
          # Current class
          d = cls.__dict__
          np = [k for k in d if not isinstance(d[k], property)]
          # Recurse through base classes excluding MycroftSkill and object
          for b in [b for b in cls.__bases__ if b not in (object, MycroftSkill)]:
              np += check_class(b)
          return np
  
      return set(check_class(obj.__class__))
  
  
  def dig_for_message():
      """Dig Through the stack for message."""
      stack = inspect.stack()
      # Limit search to 10 frames back
      stack = stack if len(stack) < 10 else stack[:10]
      local_vars = [frame[0].f_locals for frame in stack]
      for l in local_vars:
          if 'message' in l and isinstance(l['message'], Message):
              return l['message']
  
  
  def unmunge_message(message, skill_id):
      """Restore message keywords by removing the Letterified skill ID.
  
      Arguments:
          message (Message): Intent result message
          skill_id (str): skill identifier
  
      Returns:
          Message without clear keywords
      """
      if isinstance(message, Message) and isinstance(message.data, dict):
          skill_id = to_alnum(skill_id)
          for key in list(message.data.keys()):
              if key.startswith(skill_id):
                  # replace the munged key with the real one
                  new_key = key[len(skill_id):]
                  message.data[new_key] = message.data.pop(key)
  
      return message
  
  
  def get_handler_name(handler):
      """Name (including class if available) of handler function.
  
      Arguments:
          handler (function): Function to be named
  
      Returns:
          string: handler name as string
      """
      if '__self__' in dir(handler) and 'name' in dir(handler.__self__):
          return handler.__self__.name + '.' + handler.__name__
      else:
          return handler.__name__
  
  
  class MycroftSkill:
      """Base class for mycroft skills providing common behaviour and parameters
      to all Skill implementations.
  
      For information on how to get started with creating mycroft skills see
      https://https://mycroft.ai/documentation/skills/introduction-developing-skills/
  
      Arguments:
          name (str): skill name
          bus (MycroftWebsocketClient): Optional bus connection
          use_settings (bool): Set to false to not use skill settings at all
      """
      def __init__(self, name=None, bus=None, use_settings=True):
          self.name = name or self.__class__.__name__
          self.resting_name = None
          # Get directory of skill
          self._dir = dirname(abspath(sys.modules[self.__module__].__file__))
          if use_settings:
              self.settings = SkillSettings(self._dir, self.name)
          else:
              self.settings = None
  
          self.gui = SkillGUI(self)
  
          self._bus = None
          self._enclosure = None
          self.bind(bus)
          #: Mycroft global configuration. (dict)
          self.config_core = Configuration.get()
          # TODO: 19.08 - Remove
          self._config = self.config_core.get(self.name) or {}
          self.dialog_renderer = None
          self.root_dir = self._dir  #: skill root directory
  
          #: Filesystem access to skill specific folder.
          #: See mycroft.filesystem for details.
          self.file_system = FileSystemAccess(join('skills', self.name))
          self.registered
  
  [... the rest is omitted ...]
files: mycroft/skills/mycroft_skill/mycroft_skill.py
files: # -*- coding: utf-8 -*-
  # Copyright 2017 Mycroft AI Inc.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #    http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  #
  import sys
  import unittest
  
  from unittest.mock import MagicMock, patch
  from adapt.intent import IntentBuilder
  from os.path import join, dirname, abspath
  from re import error
  from datetime import datetime
  
  from mycroft.configuration import Configuration
  from mycroft.messagebus.message import Message
  from mycroft.skills.skill_data import (load_regex_from_file, load_regex,
                                         load_vocab_from_file, load_vocabulary)
  from mycroft.skills.core import (MycroftSkill, load_skill,
                                   create_skill_descriptor,
                                   resting_screen_handler)
  from mycroft.skills.intent_service import open_intent_envelope
  
  from test.util import base_config
  
  BASE_CONF = base_config()
  
  
  class MockEmitter(object):
      def __init__(self):
          self.reset()
  
      def emit(self, message):
          self.types.append(message.type)
          self.results.append(message.data)
  
      def get_types(self):
          return self.types
  
      def get_results(self):
          return self.results
  
      def on(self, event, f):
          pass
  
      def reset(self):
          self.types = []
          self.results = []
  
  
  class FunctionTest(unittest.TestCase):
      def test_resting_screen_handler(self):
          class T(MycroftSkill):
              def __init__(self):
                  self.name = 'TestObject'
  
              @resting_screen_handler('humbug')
              def f(self):
                  pass
  
          test_class = T()
          self.assertTrue('resting_handler' in dir(test_class.f))
          self.assertEquals(test_class.f.resting_handler, 'humbug')
  
  
  class MycroftSkillTest(unittest.TestCase):
      emitter = MockEmitter()
      regex_path = abspath(join(dirname(__file__), '../regex_test'))
      vocab_path = abspath(join(dirname(__file__), '../vocab_test'))
  
      def setUp(self):
          self.emitter.reset()
  
      def check_vocab_from_file(self, filename, vocab_type=None,
                                result_list=None):
          result_list = result_list or []
          load_vocab_from_file(join(self.vocab_path, filename), vocab_type,
                               self.emitter)
          self.check_emitter(result_list)
  
      def check_regex_from_file(self, filename, result_list=None):
          result_list = result_list or []
          regex_file = join(self.regex_path, filename)
          load_regex_from_file(regex_file, self.emitter, 'A')
          self.check_emitter(result_list)
  
      def check_vocab(self, path, result_list=None):
          result_list = result_list or []
          load_vocabulary(path, self.emitter, 'A')
          self.check_emitter(result_list)
  
      def check_regex(self, path, result_list=None):
          result_list = result_list or []
          load_regex(path, self.emitter, 'A')
          self.check_emitter(result_list)
  
      def check_emitter(self, result_list):
          for type in self.emitter.get_types():
              self.assertEqual(type, 'register_vocab')
          self.assertEqual(sorted(self.emitter.get_results(),
                                  key=lambda d: sorted(d.items())),
                           sorted(result_list, key=lambda d: sorted(d.items())))
          self.emitter.reset()
  
      def test_load_regex_from_file_single(self):
          self.check_regex_from_file('valid/single.rx',
                                     [{'regex': '(?P<ASingleTest>.*)'}])
  
      def test_load_regex_from_file_multiple(self):
          self.check_regex_from_file('valid/multiple.rx',
                                     [{'regex': '(?P<AMultipleTest1>.*)'},
                                      {'regex': '(?P<AMultipleTest2>.*)'}])
  
      def test_load_regex_from_file_none(self):
          self.check_regex_from_file('invalid/none.rx')
  
      def test_load_regex_from_file_invalid(self):
          with self.assertRaises(error):
              self.check_regex_from_file('invalid/invalid.rx')
  
      def test_load_regex_from_file_does_not_exist(self):
          with self.assertRaises(IOError):
              self.check_regex_from_file('does_not_exist.rx')
  
      def test_load_regex_full(self):
          self.check_regex(join(self.regex_path, 'valid'),
                           [{'regex': '(?P<AMultipleTest1>.*)'},
                            {'regex': '(?P<AMultipleTest2>.*)'},
                            {'regex': '(?P<ASingleTest>.*)'}])
  
      def test_load_regex_empty(self):
          self.check_regex(join(dirname(__file__),
                                'empty_dir'))
  
      def test_load_regex_fail(self):
          try:
              self.check_regex(join(dirname(__file__),
                                    'regex_test_fail'))
          except OSError as e:
              self.assertEqual(e.strerror, 'No such file or directory')
  
      def test_load_vocab_from_file_single(self):
          self.check_vocab_from_file('valid/single.voc', 'test_type',
                                     [{'start': 'test', 'end': 'test_type'}])
  
      def test_load_vocab_from_file_single_alias(self):
          self.check_vocab_from_file('valid/singlealias.voc', 'test_type',
                                     [{'start': 'water', 'end': 'test_type'},
                                      {'start': 'watering', 'end': 'test_type',
                                       'alias_of': 'water'}])
  
      def test_load_vocab_from_file_multiple(self):
          self.check_voc
  
  [... the rest is omitted ...]
files: test/unittests/skills/test_core.py
files: # -*- coding: utf-8 -*-
  # Copyright 2017 Mycroft AI Inc.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #    http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  #
  import sys
  import unittest
  
  from unittest.mock import MagicMock, patch
  from adapt.intent import IntentBuilder
  from os.path import join, dirname, abspath
  from re import error
  from datetime import datetime
  
  from mycroft.configuration import Configuration
  from mycroft.messagebus.message import Message
  from mycroft.skills.skill_data import (load_regex_from_file, load_regex,
                                         load_vocab_from_file, load_vocabulary)
  from mycroft.skills.core import (MycroftSkill, load_skill,
                                   create_skill_descriptor,
                                   resting_screen_handler)
  from mycroft.skills.intent_service import open_intent_envelope
  
  from test.util import base_config
  
  BASE_CONF = base_config()
  
  
  class MockEmitter(object):
      def __init__(self):
          self.reset()
  
      def emit(self, message):
          self.types.append(message.type)
          self.results.append(message.data)
  
      def get_types(self):
          return self.types
  
      def get_results(self):
          return self.results
  
      def on(self, event, f):
          pass
  
      def reset(self):
          self.types = []
          self.results = []
  
  
  class FunctionTest(unittest.TestCase):
      def test_resting_screen_handler(self):
          class T(MycroftSkill):
              def __init__(self):
                  self.name = 'TestObject'
  
              @resting_screen_handler('humbug')
              def f(self):
                  pass
  
          test_class = T()
          self.assertTrue('resting_handler' in dir(test_class.f))
          self.assertEquals(test_class.f.resting_handler, 'humbug')
  
  
  class MycroftSkillTest(unittest.TestCase):
      emitter = MockEmitter()
      regex_path = abspath(join(dirname(__file__), '../regex_test'))
      vocab_path = abspath(join(dirname(__file__), '../vocab_test'))
  
      def setUp(self):
          self.emitter.reset()
  
      def check_vocab_from_file(self, filename, vocab_type=None,
                                result_list=None):
          result_list = result_list or []
          load_vocab_from_file(join(self.vocab_path, filename), vocab_type,
                               self.emitter)
          self.check_emitter(result_list)
  
      def check_regex_from_file(self, filename, result_list=None):
          result_list = result_list or []
          regex_file = join(self.regex_path, filename)
          load_regex_from_file(regex_file, self.emitter, 'A')
          self.check_emitter(result_list)
  
      def check_vocab(self, path, result_list=None):
          result_list = result_list or []
          load_vocabulary(path, self.emitter, 'A')
          self.check_emitter(result_list)
  
      def check_regex(self, path, result_list=None):
          result_list = result_list or []
          load_regex(path, self.emitter, 'A')
          self.check_emitter(result_list)
  
      def check_emitter(self, result_list):
          for type in self.emitter.get_types():
              self.assertEqual(type, 'register_vocab')
          self.assertEqual(sorted(self.emitter.get_results(),
                                  key=lambda d: sorted(d.items())),
                           sorted(result_list, key=lambda d: sorted(d.items())))
          self.emitter.reset()
  
      def test_load_regex_from_file_single(self):
          self.check_regex_from_file('valid/single.rx',
                                     [{'regex': '(?P<ASingleTest>.*)'}])
  
      def test_load_regex_from_file_multiple(self):
          self.check_regex_from_file('valid/multiple.rx',
                                     [{'regex': '(?P<AMultipleTest1>.*)'},
                                      {'regex': '(?P<AMultipleTest2>.*)'}])
  
      def test_load_regex_from_file_none(self):
          self.check_regex_from_file('invalid/none.rx')
  
      def test_load_regex_from_file_invalid(self):
          with self.assertRaises(error):
              self.check_regex_from_file('invalid/invalid.rx')
  
      def test_load_regex_from_file_does_not_exist(self):
          with self.assertRaises(IOError):
              self.check_regex_from_file('does_not_exist.rx')
  
      def test_load_regex_full(self):
          self.check_regex(join(self.regex_path, 'valid'),
                           [{'regex': '(?P<AMultipleTest1>.*)'},
                            {'regex': '(?P<AMultipleTest2>.*)'},
                            {'regex': '(?P<ASingleTest>.*)'}])
  
      def test_load_regex_empty(self):
          self.check_regex(join(dirname(__file__),
                                'empty_dir'))
  
      def test_load_regex_fail(self):
          try:
              self.check_regex(join(dirname(__file__),
                                    'regex_test_fail'))
          except OSError as e:
              self.assertEqual(e.strerror, 'No such file or directory')
  
      def test_load_vocab_from_file_single(self):
          self.check_vocab_from_file('valid/single.voc', 'test_type',
                                     [{'start': 'test', 'end': 'test_type'}])
  
      def test_load_vocab_from_file_single_alias(self):
          self.check_vocab_from_file('valid/singlealias.voc', 'test_type',
                                     [{'start': 'water', 'end': 'test_type'},
                                      {'start': 'watering', 'end': 'test_type',
                                       'alias_of': 'water'}])
  
      def test_load_vocab_from_file_multiple(self):
          self.check_voc
  
  [... the rest is omitted ...]
files: test/unittests/skills/test_core.py