# Path: googkit/lib/error.py
# class GoogkitError(Exception):
#     """Base class for error in Googkit."""
# 
#     def __init__(self, message):
#         """Creates a local error of googkit by the specified message.
#         """
#         self._message = message
# 
#     @property
#     def message(self):
#         return self._message
# 
#     def __str__(self):
#         return self.message


import unittest
import os
import re
import googkit.lib.path
from googkit.compat.unittest import mock
from googkit.lib.error import GoogkitError
        with mock.patch('googkit.lib.path.googkit_root', return_value=dummy_googkit_root), \
                mock.patch('os.path.isdir', side_effect=stub_isdir):
            self.assertPathEqual(
                googkit.lib.path.plugin(),
                '/dummy/usr/local/googkit/googkit/plugins')

    def test_plugin_with_directory_missing(self):
        dummy_googkit_root = os.path.normcase('/dummy/usr/local/googkit')
        with mock.patch('googkit.lib.path.googkit_root', return_value=dummy_googkit_root), \
                mock.patch('os.path.isdir', return_value=False):
            with self.assertRaises(GoogkitError):
                self.assertPathEqual(
                    googkit.lib.path.plugin(),
                    '/dummy/usr/local/googkit/plugins')

    def test_template(self):
        def stub_isdir(path):
            return is_path_equal(path, '/dummy/usr/local/googkit/googkit_data/template')

        dummy_googkit_root = os.path.normcase('/dummy/usr/local/googkit')
        with mock.patch('googkit.lib.path.googkit_root', return_value=dummy_googkit_root), \
                mock.patch('os.path.isdir', side_effect=stub_isdir):
            self.assertPathEqual(
                googkit.lib.path.template(),
                '/dummy/usr/local/googkit/googkit_data/template')

    def test_template_with_directory_missing(self):
        dummy_googkit_root = os.path.normcase('/dummy/usr/local/googkit')
        with mock.patch('googkit.lib.path.googkit_root', return_value=dummy_googkit_root), \
                mock.patch('os.path.isdir', return_value=False):

# Path: googkit/lib/error.py
# class GoogkitError(Exception):
#     """Base class for error in Googkit."""
# 
#     def __init__(self, message):
#         """Creates a local error of googkit by the specified message.
#         """
#         self._message = message
# 
#     @property
#     def message(self):
#         return self._message
# 
#     def __str__(self):
#         return self.message


# Path: test/lib/test_path.py
import unittest
import os
import re
import googkit.lib.path
from googkit.compat.unittest import mock
from googkit.lib.error import GoogkitError

        with mock.patch('googkit.lib.path.googkit_root', return_value=dummy_googkit_root), \
                mock.patch('os.path.isdir', side_effect=stub_isdir):
            self.assertPathEqual(
                googkit.lib.path.plugin(),
                '/dummy/usr/local/googkit/googkit/plugins')

    def test_plugin_with_directory_missing(self):
        dummy_googkit_root = os.path.normcase('/dummy/usr/local/googkit')
        with mock.patch('googkit.lib.path.googkit_root', return_value=dummy_googkit_root), \
                mock.patch('os.path.isdir', return_value=False):
            with self.assertRaises(GoogkitError):
                self.assertPathEqual(
                    googkit.lib.path.plugin(),
                    '/dummy/usr/local/googkit/plugins')

    def test_template(self):
        def stub_isdir(path):
            return is_path_equal(path, '/dummy/usr/local/googkit/googkit_data/template')

        dummy_googkit_root = os.path.normcase('/dummy/usr/local/googkit')
        with mock.patch('googkit.lib.path.googkit_root', return_value=dummy_googkit_root), \
                mock.patch('os.path.isdir', side_effect=stub_isdir):
            self.assertPathEqual(
                googkit.lib.path.template(),
                '/dummy/usr/local/googkit/googkit_data/template')

    def test_template_with_directory_missing(self):
        dummy_googkit_root = os.path.normcase('/dummy/usr/local/googkit')
        with mock.patch('googkit.lib.path.googkit_root', return_value=dummy_googkit_root), \
                mock.patch('os.path.isdir', return_value=False):

            with self.assertRaises(GoogkitError):