'Generate and upload a new tool_dependencies.xml file that specifies an arbitrary file on the filesystem, and verify that bwa_base depends on the new changeset revision.'

def test_0040_generate_tool_dependency(self):

    base_repository = self.test_db_util.get_repository_by_name_and_owner(bwa_base_repository_name, common.test_user_1_name)
    tool_repository = self.test_db_util.get_repository_by_name_and_owner(bwa_package_repository_name, common.test_user_1_name)
    previous_changeset = self.get_repository_tip(tool_repository)
    old_tool_dependency = self.get_filename(os.path.join('bwa', 'complex', 'readme', 'tool_dependencies.xml'))
    new_tool_dependency_path = self.generate_temp_path('test_1100', additional_paths=['tool_dependency'])
    xml_filename = os.path.abspath(os.path.join(new_tool_dependency_path, 'tool_dependencies.xml'))
    open(xml_filename, 'w').write(open(old_tool_dependency, 'r').read().replace('__PATH__', self.get_filename('bwa/complex')))
    self.upload_file(tool_repository, filename=xml_filename, filepath=new_tool_dependency_path, valid_tools_only=True, uncompress_file=False, remove_repo_files_not_in_tar=False, commit_message='Uploaded    new    tool_dependencies.xml.', strings_displayed=[], strings_not_displayed=[])
    repository_tip = self.get_repository_tip(tool_repository)
    strings_displayed = ['bwa', '0.5.9', 'package']
    strings_displayed.append(repository_tip)
    strings_not_displayed = [previous_changeset]
    self.display_manage_repository_page(tool_repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed)
    self.display_manage_repository_page(tool_repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed)
    self.display_manage_repository_page(base_repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed)
