'Upload a new tool_dependencies.xml to the tool repository, and verify that the base repository displays the new changeset.'

def test_0040_update_tool_repository(self):

    global running_standalone
    if running_standalone:
        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=[])
        self.display_manage_repository_page(base_repository, strings_displayed=[self.get_repository_tip(tool_repository), 'bwa', '0.5.9', 'package'], strings_not_displayed=[previous_changeset])
