<commit_before>"""Tests for src.docker.ants.ANTs"""
from __future__ import absolute_import, division, print_function

import pytest

from neurodocker.docker.ants import ANTs, manage_pkgs

def test_manage_pkgs():
    assert 'yum' in manage_pkgs.keys(), "yum not found"
    assert 'apt' in manage_pkgs.keys(), "apt not found"

    # Test that each entry is a dictionary with 'install' and 'remove' keys.
    for manager in manage_pkgs:
        assert 'install' in manage_pkgs[manager].keys(), 'install not found'
        assert 'remove' in manage_pkgs[manager].keys(), 'remove not found'

    assert "yum" not in manage_pkgs['apt'].values()
    assert "apt" not in manage_pkgs['yum'].values()


class TestANTs(object):
    """Tests for ANTs class."""
    def install_binaries_apt(self):
        # --- Version 2.1.0 ---
        # apt
        url = "https://www.dropbox.com/s/x7eyk125bhwiisu/ants-2.1.0_centos-5.tar.gz?dl=1"
        test = ("#-------------------\n"
                "# Install ANTs 2.1.0\n"
                "#-------------------\n"
                "WORKDIR /opt\n"
                "RUN deps='ca-certificates wget' \\\n"
                "    && apt-get update -qq && apt-get install -yq --no-install-recommends $deps \\\n"
                "    && wget -qO ants.tar.gz {url} \\\n"
                "    && tar xzf ants.tar.gz \\\n"
                "    && rm -f ants.tar.gz \\\n"
                "    && apt-get purge -y --auto-remove $deps\n"
                "ENV ANTSPATH=/opt/ants\n"
                "ENV PATH=$ANTSPATH:$PATH".format(url=url))<commit_msg>enh: test manage_pkgs in test_utils<commit_after>"""Tests for src.docker.ants.ANTs"""
from __future__ import absolute_import, division, print_function

import pytest

from neurodocker.interfaces import ANTs


class TestANTs(object):
    """Tests for ANTs class."""
    def install_binaries_apt(self):
        # --- Version 2.1.0 ---
        # apt
        url = "https://www.dropbox.com/s/x7eyk125bhwiisu/ants-2.1.0_centos-5.tar.gz?dl=1"
        test = ("#-------------------\n"
                "# Install ANTs 2.1.0\n"
                "#-------------------\n"
                "WORKDIR /opt\n"
                "RUN deps='ca-certificates wget' \\\n"
                "    && apt-get update -qq && apt-get install -yq --no-install-recommends $deps \\\n"
                "    && wget -qO ants.tar.gz {url} \\\n"
                "    && tar xzf ants.tar.gz \\\n"
                "    && rm -f ants.tar.gz \\\n"
                "    && apt-get purge -y --auto-remove $deps\n"
                "ENV ANTSPATH=/opt/ants\n"
                "ENV PATH=$ANTSPATH:$PATH".format(url=url))
{'fraction_non_alphanumeric': 0.17778620166793024, 'fraction_numerical': 0.011372251705837756, 'mean_word_length': 1.6764705882352942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2127304', 'n_tokens_mistral': 927, 'n_tokens_neox': 870, 'n_words': 202}