# Path: muranoagent/bunch.py
# class Bunch(dict):
#     def __getattr__(self, item):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
# 
# Path: muranoagent/common/config.py
# CONF = cfg.CONF
# def parse_args(args=None, usage=None, default_config_files=None):
# 
# Path: muranoagent/files_manager.py
# CONF = config.CONF
# LOG = logging.getLogger(__name__)
# class FilesManager(object):
#     def __init__(self, execution_plan):
#     def put_file(self, file_id, script):
#     def _make_symlink(self, cache_path, file_name, script):
#     def _fetch_file(self, file_id):
#     def _download_url_file(self, file_def, file_id):
#     def clear(self):
#     def _download_file(self, url, path):
#     def _url(self, file):
#     def _is_git_repository(self, url):
#     def _is_svn_repository(self, url):
#     def _download_svn(self, url_file, folder):
#     def _execute_command(self, command):
# 
# Path: muranoagent/tests/unit/base.py
# CONF = cfg.CONF
# class MuranoAgentTestCase(testtools.TestCase):
#     def setUp(self):
#     def override_config(self, name, override, group=None):


import os.path
from unittest import mock
from muranoagent import bunch
from muranoagent.common import config as cfg
from muranoagent import files_manager
from muranoagent.tests.unit import base
        files = files_manager.FilesManager(template)
        for file in template.get('Files'):
            files.put_file(file, 'deploy')

    @mock.patch('builtins.open')
    @mock.patch('os.path.lexists')
    @mock.patch('os.path.isdir')
    @mock.patch('os.makedirs')
    def test_putfile_file(self, mock_makedir, mock_path,
                          mock_exists, open_mock):
        """It tests the putfile method."""
        mock_path.return_value = True
        mock_makedir.return_value = None
        mock_exists.return_value = True
        context_manager_mock = mock.Mock()
        open_mock.return_value = context_manager_mock
        file_mock = mock.Mock()
        file_mock.read.return_value = ''
        enter_mock = mock.Mock()
        enter_mock.return_value = file_mock
        exit_mock = mock.Mock()
        setattr(context_manager_mock, '__enter__', enter_mock)
        setattr(context_manager_mock, '__exit__', exit_mock)

        template = self.get_template_file()
        files = files_manager.FilesManager(template)
        for file in template.get('Files'):
            files.put_file(file, 'deploy')

    def get_template_downloable_git(self):

# Path: muranoagent/bunch.py
# class Bunch(dict):
#     def __getattr__(self, item):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
# 
# Path: muranoagent/common/config.py
# CONF = cfg.CONF
# def parse_args(args=None, usage=None, default_config_files=None):
# 
# Path: muranoagent/files_manager.py
# CONF = config.CONF
# LOG = logging.getLogger(__name__)
# class FilesManager(object):
#     def __init__(self, execution_plan):
#     def put_file(self, file_id, script):
#     def _make_symlink(self, cache_path, file_name, script):
#     def _fetch_file(self, file_id):
#     def _download_url_file(self, file_def, file_id):
#     def clear(self):
#     def _download_file(self, url, path):
#     def _url(self, file):
#     def _is_git_repository(self, url):
#     def _is_svn_repository(self, url):
#     def _download_svn(self, url_file, folder):
#     def _execute_command(self, command):
# 
# Path: muranoagent/tests/unit/base.py
# CONF = cfg.CONF
# class MuranoAgentTestCase(testtools.TestCase):
#     def setUp(self):
#     def override_config(self, name, override, group=None):


# Path: muranoagent/tests/unit/test_files_manager.py
import os.path
from unittest import mock
from muranoagent import bunch
from muranoagent.common import config as cfg
from muranoagent import files_manager
from muranoagent.tests.unit import base

        files = files_manager.FilesManager(template)
        for file in template.get('Files'):
            files.put_file(file, 'deploy')

    @mock.patch('builtins.open')
    @mock.patch('os.path.lexists')
    @mock.patch('os.path.isdir')
    @mock.patch('os.makedirs')
    def test_putfile_file(self, mock_makedir, mock_path,
                          mock_exists, open_mock):
        """It tests the putfile method."""
        mock_path.return_value = True
        mock_makedir.return_value = None
        mock_exists.return_value = True
        context_manager_mock = mock.Mock()
        open_mock.return_value = context_manager_mock
        file_mock = mock.Mock()
        file_mock.read.return_value = ''
        enter_mock = mock.Mock()
        enter_mock.return_value = file_mock
        exit_mock = mock.Mock()
        setattr(context_manager_mock, '__enter__', enter_mock)
        setattr(context_manager_mock, '__exit__', exit_mock)

        template = self.get_template_file()
        files = files_manager.FilesManager(template)
        for file in template.get('Files'):
            files.put_file(file, 'deploy')

    def get_template_downloable_git(self):

        return bunch.Bunch(