def test_integrate(self):
        scripts_dir = tempfile.mkdtemp(dir=self.tmp_dir)
        self._dirs_to_clean_up = [scripts_dir]
        copyfile(self.script1, path.join(scripts_dir, 'script1.py'))
        copyfile(self.script2, path.join(scripts_dir, 'script2.py'))
        copyfile(self.script3, path.join(scripts_dir, 'script3.py'))

        galaxy_dir = tempfile.mkdtemp(dir=self.tmp_dir)
        self._dirs_to_clean_up.append(galaxy_dir)
        galaxy_tool_conf_fp = path.join(galaxy_dir, 'tool_conf.xml')
        f = open(galaxy_tool_conf_fp, 'w')
        f.close()
        galaxy_tools_dir = path.join(galaxy_dir, 'tools')
        mkdir(galaxy_tools_dir)

        integrate(scripts_dir, galaxy_dir, self.config_file, False, None)

        self.assertTrue(path.exists(path.join(scripts_dir, 'integration.log')),
            "The log file was not created in the appropriate location")

        log_d, log_fp = tempfile.mkstemp(dir=self.tmp_dir)
        self._paths_to_clean_up = [log_fp]
        integrate(scripts_dir, galaxy_dir, self.config_file, True, log_fp)

        self.assertTrue(path.exists(log_fp),
            "The log file was not created in the appropriate location")
"%prog -i scripts_dir -g galaxy_dist_dir -c config_file.txt")]
script_info['output_description'] = ""
script_info['required_options'] = [
    make_option('-i', '--input_dir', type="existing_dirpath",
                help='directory containing the scripts to integrate'),
    make_option('-g', '--galaxy_dist_dir', type="existing_dirpath",
                help='The Galaxy installation directory'),
    make_option('-c', '--config_file', type="existing_filepath",
                help='Configuration file which contains the section structure' +
                    ' of the scripts')
]
script_info['optional_options'] = [
    make_option('--update_tool_conf', action='store_true',
                help='By default, the Galaxy tool_conf file is overwritten.' + 
                    ' Use this option to update it instead of overwrite it.'),
    make_option('-l', '--log_file', type='new_filepath',
                help='File path where to store the log file.' +
                    ' [Default: input_dir/integration.log]')
]
script_info['version'] = __version__

if __name__ == '__main__':
    option_parser, opts, args = parse_command_line_parameters(**script_info)
    input_dir = opts.input_dir
    galaxy_dir = opts.galaxy_dist_dir
    config_file_fp = opts.config_file
    update = opts.update_tool_conf
    log_fp = opts.log_file

    integrate(input_dir, galaxy_dir, config_file_fp, update, log_fp)