# Path: tests/helpers.py
# class YodaTestHelper(unittest.TestCase):
#     """Yoda test helper class.
#     This class provides custom assertions for yoda's tests suite.
#     """
#     sandbox = None
# 
#     def setUp(self):
#         """Setup sandbox."""
#         self.sandbox = Sandbox()
# 
#     def tearDown(self):
#         """Destroy sandbox."""
#         self.sandbox.destroy()
# 
#     def assert_config_file_contains(self, config_file, expected):
#         """Custom assert to check content of config_file."""
#         file = open(config_file)
#         config = yaml.safe_load(file.read())
#         file.close()
#         self.assertEqual(config, expected)
# 
# Path: yoda/adapter/abstract.py
# class Abstract:
#     """SCM Adapter interface."""
#     __metaclass__ = ABCMeta
# 
#     path = None
#     executable = None
# 
#     def __init__(self, path):
#         self.path = path
# 
#     def execute(self, command, path=None):
#         """Execute command with os.popen and return output."""
#         logger = logging.getLogger(__name__)
# 
#         self.check_executable()
#         logger.debug("Executing command `%s` (cwd: %s)" % (command, path))
#         process = subprocess.Popen(
#             command,
#             shell=True,
#             cwd=path,
#             stdout=subprocess.PIPE,
#             stderr=subprocess.PIPE
#         )
#         stdout, stderr = process.communicate()
#         exit_code = process.wait()
# 
#         if stdout:
#             logger.info(stdout.decode("utf-8"))
# 
#         if stderr:
#             if exit_code != 0:
#                 logger.error(stderr.decode("utf-8"))
#             else:
#                 logger.info(stderr.decode("utf-8"))
# 
#         return process
# 
#     def exec_on_path(self, command):
#         """Execute command in repository path."""
#         self.execute("%s" % command, self.path)
# 
#     def check_executable(self):
#         """Check adapter executable exists."""
#         if not find_executable(self.executable):
#             raise ExecutableNotFoundException(
#                 "Executable %s not found" % self.executable
#             )
# 
#     @abstractmethod
#     def status(self):
#         pass
# 
#     @abstractmethod
#     def update(self):
#         pass
# 
#     @abstractmethod
#     def show(self):
#         pass
# 
#     @abstractmethod
#     def clone(self):
#         pass
# 
# Path: yoda/adapter/abstract.py
# class ExecutableNotFoundException(OSError):
#     pass


import mock
import os
import subprocess
from mock import patch
from testfixtures import LogCapture
from tests.helpers import YodaTestHelper
from yoda.adapter import Abstract
from yoda.adapter import ExecutableNotFoundException
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Yoda is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Yoda. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.



class TestAdapter(Abstract):
    def __init__(self, path):
        super(TestAdapter, self).__init__(path)

    def status(self):
        pass

    def update(self):
        pass

    def show(self):
        pass

    def clone(self):
        pass



# Path: tests/helpers.py
# class YodaTestHelper(unittest.TestCase):
#     """Yoda test helper class.
#     This class provides custom assertions for yoda's tests suite.
#     """
#     sandbox = None
# 
#     def setUp(self):
#         """Setup sandbox."""
#         self.sandbox = Sandbox()
# 
#     def tearDown(self):
#         """Destroy sandbox."""
#         self.sandbox.destroy()
# 
#     def assert_config_file_contains(self, config_file, expected):
#         """Custom assert to check content of config_file."""
#         file = open(config_file)
#         config = yaml.safe_load(file.read())
#         file.close()
#         self.assertEqual(config, expected)
# 
# Path: yoda/adapter/abstract.py
# class Abstract:
#     """SCM Adapter interface."""
#     __metaclass__ = ABCMeta
# 
#     path = None
#     executable = None
# 
#     def __init__(self, path):
#         self.path = path
# 
#     def execute(self, command, path=None):
#         """Execute command with os.popen and return output."""
#         logger = logging.getLogger(__name__)
# 
#         self.check_executable()
#         logger.debug("Executing command `%s` (cwd: %s)" % (command, path))
#         process = subprocess.Popen(
#             command,
#             shell=True,
#             cwd=path,
#             stdout=subprocess.PIPE,
#             stderr=subprocess.PIPE
#         )
#         stdout, stderr = process.communicate()
#         exit_code = process.wait()
# 
#         if stdout:
#             logger.info(stdout.decode("utf-8"))
# 
#         if stderr:
#             if exit_code != 0:
#                 logger.error(stderr.decode("utf-8"))
#             else:
#                 logger.info(stderr.decode("utf-8"))
# 
#         return process
# 
#     def exec_on_path(self, command):
#         """Execute command in repository path."""
#         self.execute("%s" % command, self.path)
# 
#     def check_executable(self):
#         """Check adapter executable exists."""
#         if not find_executable(self.executable):
#             raise ExecutableNotFoundException(
#                 "Executable %s not found" % self.executable
#             )
# 
#     @abstractmethod
#     def status(self):
#         pass
# 
#     @abstractmethod
#     def update(self):
#         pass
# 
#     @abstractmethod
#     def show(self):
#         pass
# 
#     @abstractmethod
#     def clone(self):
#         pass
# 
# Path: yoda/adapter/abstract.py
# class ExecutableNotFoundException(OSError):
#     pass


# Path: tests/adapter/abstract_test.py
import mock
import os
import subprocess
from mock import patch
from testfixtures import LogCapture
from tests.helpers import YodaTestHelper
from yoda.adapter import Abstract
from yoda.adapter import ExecutableNotFoundException

# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Yoda is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Yoda. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.



class TestAdapter(Abstract):
    def __init__(self, path):
        super(TestAdapter, self).__init__(path)

    def status(self):
        pass

    def update(self):
        pass

    def show(self):
        pass

    def clone(self):
        pass



class TestAdapterAbstract(YodaTestHelper):