def test_env_to_rc_injection(self):
        """ If env_source_rc is set to true, the env environments should source the rc """
        # test bash, gui, no zshell
        global_config = create_default_config()
        global_config.set('global', 'env_source_rc', True)
        with MockEnvironment(test_source, test_target, global_config=global_config) as environment:
            environment.install()

            # bash
            env_injected = False
            full_rc_path = os.path.expanduser(os.path.join("~", ".bashrc"))
            for profile in ['.bash_profile', '.bash_login', '.profile']:
                full_profile_path = os.path.expanduser(os.path.join("~", profile))
                specific_env_injected = full_profile_path in environment.global_injections.inject_dict
                if specific_env_injected:
                    env_injected = True
                    assert (source_template % (full_rc_path, full_rc_path) in
                            environment.global_injections.inject_dict[full_profile_path])
            assert env_injected

            # zshell
            env_injected = False
            full_rc_path = os.path.expanduser(os.path.join("~", ".zshrc"))
            for profile in ['.zprofile', '.zlogin']:
                full_profile_path = os.path.expanduser(os.path.join("~", profile))
                specific_env_injected = full_profile_path in environment.global_injections.inject_dict
                if specific_env_injected:
                    env_injected = True
                    assert (source_template % (full_rc_path, full_rc_path) in
                            environment.global_injections.inject_dict[full_profile_path])
            assert env_injected
dataset/ETHPy150Open toumorokoshi/sprinter/sprinter/tests/test_environment.py/TestEnvironment.test_env_to_rc_injection/original