# Path: sprinter/environment.py
# def warmup(f):
#     def wrapped(self, *args, **kwargs):
# def install_required(f):
#     def wrapped(self, *args, **kwargs):
#     def __init__(self,
#                  logger=None,
#                  logging_level=logging.INFO,
#                  root=None,
#                  sprinter_namespace=None,
#                  global_config=None,
#                  ignore_errors=False):
#     def install(self):
#     def update(self, reconfigure=False):
#     def remove(self):
#     def deactivate(self):
#     def activate(self):
#     def validate(self):
#     def inject_environment_config(self):
#     def clear_all(self):
#     def install_sandboxes(self):
#     def instantiate_features(self):
#     def run_feature(self, feature, action):
#     def write_debug_log(self, file_path):
#     def write_manifest(self):
#     def message_failure(self):
#     def message_success(self):
#     def warmup(self):
#     def _inject_config_source(self, source_filename, files_to_inject):
#     def _finalize(self):
#     def _install_sandbox(self, name, call, kwargs={}):
#     def _build_logger(self, level=logging.INFO):
#     def log_error(self, error_message):
#     def log_feature_error(self, feature, error_message):
#     def get_error_value(self, feature):
#     def run_action(self, feature, action,
#                    run_if_error=False,
#                    raise_exception=True):
#     def _validate_manifest(self):
#     def _specialize(self, reconfigure=False):
#     def _copy_source_to_target(self):
#     def grab_inputs(self, reconfigure=False):
# SHELL_CONFIG = {
#     'bash': {
#         'rc': ['.bashrc'],
#         'env': ['.bash_profile', '.bash_login', '.profile']
#     },
#     'zsh': {
#         'rc': ['.zshrc'],
#         'env': ['.zprofile', '.zlogin']
#     },
#     'gui': {
#         'debian': ['.profile'],
#         'osx': lib.insert_environment_osx
#     }
# }
# RC_FILES = []
# ENV_FILES = []
# CONFIG_FILES = RC_FILES + ENV_FILES
# class Environment(object):
# 
# Path: sprinter/core/globals.py
# def create_default_config():
#     """ Create a default configuration object, with all parameters filled """
#     config = configparser.RawConfigParser()
#     config.add_section('global')
#     config.set('global', 'env_source_rc', False)
#     config.add_section('shell')
#     config.set('shell', 'bash', "true")
#     config.set('shell', 'zsh', "true")
#     config.set('shell', 'gui', "true")
#     return config


import tempfile
import shutil
import httpretty
from sprinter import environment
from sprinter.core.globals import create_default_config
from nose.plugins.attrib import attr
from mock import patch
            TEST_URI = "http://testme.com/test.cfg"
            httpretty.register_uri(httpretty.GET, TEST_URI,
                                   body=open("./test_data/test_setup.cfg").read())
            env = environment.Environment(root=temp_directory, sprinter_namespace='test',
                                          global_config=self.global_config)
            env.target = TEST_URI
            env.install()
            env = environment.Environment(root=temp_directory, sprinter_namespace='test',
                                          global_config=self.global_config)
            env.source = TEST_URI
            env.remove()
        finally:
            shutil.rmtree(temp_directory)

    @httpretty.activate
    @patch('sprinter.lib.prompt')
    def _test_standalone_sprinter(self, prompt):
        """ The standalone sprinter lifecycle should install, update, and remove sprinter """
        prompt.return_value = "yes"
        temp_directory = tempfile.mkdtemp()
        try:
            TEST_URI = "http://testme.com/test.cfg"
            httpretty.register_uri(httpretty.GET, TEST_URI,
                                   body=open("./examples/sprinter.cfg").read())
            # install
            env = environment.Environment(root=temp_directory, sprinter_namespace='test',
                                          global_config=self.global_config)
            env.target = TEST_URI
            env.install()
            # update

# Path: sprinter/environment.py
# def warmup(f):
#     def wrapped(self, *args, **kwargs):
# def install_required(f):
#     def wrapped(self, *args, **kwargs):
#     def __init__(self,
#                  logger=None,
#                  logging_level=logging.INFO,
#                  root=None,
#                  sprinter_namespace=None,
#                  global_config=None,
#                  ignore_errors=False):
#     def install(self):
#     def update(self, reconfigure=False):
#     def remove(self):
#     def deactivate(self):
#     def activate(self):
#     def validate(self):
#     def inject_environment_config(self):
#     def clear_all(self):
#     def install_sandboxes(self):
#     def instantiate_features(self):
#     def run_feature(self, feature, action):
#     def write_debug_log(self, file_path):
#     def write_manifest(self):
#     def message_failure(self):
#     def message_success(self):
#     def warmup(self):
#     def _inject_config_source(self, source_filename, files_to_inject):
#     def _finalize(self):
#     def _install_sandbox(self, name, call, kwargs={}):
#     def _build_logger(self, level=logging.INFO):
#     def log_error(self, error_message):
#     def log_feature_error(self, feature, error_message):
#     def get_error_value(self, feature):
#     def run_action(self, feature, action,
#                    run_if_error=False,
#                    raise_exception=True):
#     def _validate_manifest(self):
#     def _specialize(self, reconfigure=False):
#     def _copy_source_to_target(self):
#     def grab_inputs(self, reconfigure=False):
# SHELL_CONFIG = {
#     'bash': {
#         'rc': ['.bashrc'],
#         'env': ['.bash_profile', '.bash_login', '.profile']
#     },
#     'zsh': {
#         'rc': ['.zshrc'],
#         'env': ['.zprofile', '.zlogin']
#     },
#     'gui': {
#         'debian': ['.profile'],
#         'osx': lib.insert_environment_osx
#     }
# }
# RC_FILES = []
# ENV_FILES = []
# CONFIG_FILES = RC_FILES + ENV_FILES
# class Environment(object):
# 
# Path: sprinter/core/globals.py
# def create_default_config():
#     """ Create a default configuration object, with all parameters filled """
#     config = configparser.RawConfigParser()
#     config.add_section('global')
#     config.set('global', 'env_source_rc', False)
#     config.add_section('shell')
#     config.set('shell', 'bash', "true")
#     config.set('shell', 'zsh', "true")
#     config.set('shell', 'gui', "true")
#     return config


# Path: sprinter/tests/test_lifecycle.py
import tempfile
import shutil
import httpretty
from sprinter import environment
from sprinter.core.globals import create_default_config
from nose.plugins.attrib import attr
from mock import patch

            TEST_URI = "http://testme.com/test.cfg"
            httpretty.register_uri(httpretty.GET, TEST_URI,
                                   body=open("./test_data/test_setup.cfg").read())
            env = environment.Environment(root=temp_directory, sprinter_namespace='test',
                                          global_config=self.global_config)
            env.target = TEST_URI
            env.install()
            env = environment.Environment(root=temp_directory, sprinter_namespace='test',
                                          global_config=self.global_config)
            env.source = TEST_URI
            env.remove()
        finally:
            shutil.rmtree(temp_directory)

    @httpretty.activate
    @patch('sprinter.lib.prompt')
    def _test_standalone_sprinter(self, prompt):
        """ The standalone sprinter lifecycle should install, update, and remove sprinter """
        prompt.return_value = "yes"
        temp_directory = tempfile.mkdtemp()
        try:
            TEST_URI = "http://testme.com/test.cfg"
            httpretty.register_uri(httpretty.GET, TEST_URI,
                                   body=open("./examples/sprinter.cfg").read())
            # install
            env = environment.Environment(root=temp_directory, sprinter_namespace='test',
                                          global_config=self.global_config)
            env.target = TEST_URI
            env.install()
            # update

            env = environment.Environment(root=temp_directory, sprinter_namespace='test',