# Path: ensembler/tests/integrationtest_utils.py
# @contextlib.contextmanager
# def integrationtest_context(set_up_project_stage='init'):
#     temp_dir = tempfile.mkdtemp()
#     ensembler.initproject.InitProject(temp_dir)
#     cwd = os.getcwd()
# 
#     set_up_project_stage_methods = SetUpSampleProject(temp_dir)
#     set_up_method = getattr(set_up_project_stage_methods, set_up_project_stage)
#     set_up_method()
# 
#     os.chdir(temp_dir)
#     yield temp_dir
#     os.chdir(cwd)
#     shutil.rmtree(temp_dir)
# 
# Path: ensembler/utils.py
# @contextlib.contextmanager
# def enter_temp_dir():
#     """Create a temporary directory, enter, yield, exit, rmdir; used as context manager."""
#     temp_dir = tempfile.mkdtemp()
#     cwd = os.getcwd()
#     os.chdir(temp_dir)
#     yield temp_dir
#     os.chdir(cwd)
#     shutil.rmtree(temp_dir)
# 
# def get_installed_resource_filename(relative_path):
#     """
#     Returns the installation path of a resource file shipped with the code.
# 
#     Parameters
#     ----------
#     name: str
#         Name of the file to load (relative to the `ensembler` main code directory).
# 
#     Returns
#     -------
#     installed_filepath: str
#         absolute path of the installed file
# 
#     Examples
#     --------
#     >>> pathname = get_installed_resource_filename('tests/example_project/meta0.yaml')
#     """
#     installed_filepath = resource_filename(ensembler.__name__, relative_path)
# 
#     if not os.path.exists(installed_filepath):
#         raise ValueError(
#             "Sorry! {0} does not exist."
#             "If you just added it, you'll have to re-install".format(relative_path)
#         )
# 
#     return installed_filepath


import os
import shutil
import datetime
import ensembler
import ensembler.tests
import ensembler.modeling
import ensembler.cli_commands
    import modeller
    import modeller.automodel
from mock import Mock
from nose.plugins.attrib import attr
from ensembler.tests.integrationtest_utils import integrationtest_context
from ensembler.utils import enter_temp_dir, get_installed_resource_filename


@attr('modeller')
def test_import_modeller():


@attr('modeller')
def test_build_model():
    template_filepath = get_installed_resource_filename(os.path.join('tests', 'resources',  'mock_template.pdb'))

# Path: ensembler/tests/integrationtest_utils.py
# @contextlib.contextmanager
# def integrationtest_context(set_up_project_stage='init'):
#     temp_dir = tempfile.mkdtemp()
#     ensembler.initproject.InitProject(temp_dir)
#     cwd = os.getcwd()
# 
#     set_up_project_stage_methods = SetUpSampleProject(temp_dir)
#     set_up_method = getattr(set_up_project_stage_methods, set_up_project_stage)
#     set_up_method()
# 
#     os.chdir(temp_dir)
#     yield temp_dir
#     os.chdir(cwd)
#     shutil.rmtree(temp_dir)
# 
# Path: ensembler/utils.py
# @contextlib.contextmanager
# def enter_temp_dir():
#     """Create a temporary directory, enter, yield, exit, rmdir; used as context manager."""
#     temp_dir = tempfile.mkdtemp()
#     cwd = os.getcwd()
#     os.chdir(temp_dir)
#     yield temp_dir
#     os.chdir(cwd)
#     shutil.rmtree(temp_dir)
# 
# def get_installed_resource_filename(relative_path):
#     """
#     Returns the installation path of a resource file shipped with the code.
# 
#     Parameters
#     ----------
#     name: str
#         Name of the file to load (relative to the `ensembler` main code directory).
# 
#     Returns
#     -------
#     installed_filepath: str
#         absolute path of the installed file
# 
#     Examples
#     --------
#     >>> pathname = get_installed_resource_filename('tests/example_project/meta0.yaml')
#     """
#     installed_filepath = resource_filename(ensembler.__name__, relative_path)
# 
#     if not os.path.exists(installed_filepath):
#         raise ValueError(
#             "Sorry! {0} does not exist."
#             "If you just added it, you'll have to re-install".format(relative_path)
#         )
# 
#     return installed_filepath


# Path: ensembler/tests/test_modeling.py
import os
import shutil
import datetime
import ensembler
import ensembler.tests
import ensembler.modeling
import ensembler.cli_commands
    import modeller
    import modeller.automodel
from mock import Mock
from nose.plugins.attrib import attr
from ensembler.tests.integrationtest_utils import integrationtest_context
from ensembler.utils import enter_temp_dir, get_installed_resource_filename



@attr('modeller')
def test_import_modeller():


@attr('modeller')
def test_build_model():
    template_filepath = get_installed_resource_filename(os.path.join('tests', 'resources',  'mock_template.pdb'))

    aln_filepath = get_installed_resource_filename(os.path.join('tests', 'resources', 'mock_template-alignment.pir'))