'Create a dependency on package_numpy_1_7_0170.'

def test_0015_create_complex_repository_dependency(self):

    '\n                                This    is    step    2    -    Create    a    complex    repository    dependency    on    package_numpy_1_7_0170,    and    upload    this    to    package_matplotlib_1_2_0170.\n                                package_matplotlib_1_2_0170    should    depend    on    package_numpy_1_7_0170,    with    prior_installation_required\n                                set    to    True.    When    matplotlib    is    selected    for    installation,    the    result    should    be    that    numpy    is    compiled\n                                and    installed    first.\n                                '
    global running_standalone
    numpy_repository = self.test_db_util.get_repository_by_name_and_owner(numpy_repository_name, common.test_user_1_name)
    matplotlib_repository = self.test_db_util.get_repository_by_name_and_owner(matplotlib_repository_name, common.test_user_1_name)
    new_xml = '                <package    name="numpy"    version="1.7">\n'
    new_xml += '                                <repository    toolshed="%s"    name="%s"    owner="%s"    changeset_revision="%s"    prior_installation_required="True"    />\n'
    new_xml += '                </package>\n'
    url = self.url
    name = numpy_repository.name
    owner = numpy_repository.user.username
    if running_standalone:
        changeset_revision = self.get_repository_tip(numpy_repository)
        processed_xml = (new_xml % (url, name, owner, changeset_revision))
        original_xml = open(self.get_filename('package_matplotlib/tool_dependencies.xml'), 'r').read()
        dependency_xml_path = self.generate_temp_path('test_0170', additional_paths=['matplotlib'])
        new_xml_file = os.path.join(dependency_xml_path, 'tool_dependencies.xml')
        open(new_xml_file, 'w').write(original_xml.replace('<!--NUMPY-->', processed_xml))
        self.upload_file(matplotlib_repository, filename='tool_dependencies.xml', filepath=dependency_xml_path, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded    complex    repository    dependency    on    numpy    1.7.', strings_displayed=[], strings_not_displayed=[])
