<commit_before>"""Tests for neurodocker.interfaces.Miniconda"""
# Author: <NAME> <<EMAIL>>
from __future__ import absolute_import, division, print_function

from neurodocker.interfaces import Miniconda
from neurodocker.interfaces.tests import utils

class TestMiniconda(object):
    """Tests for Miniconda class."""

    def test_build_image_miniconda_latest_shellscript_xenial(self):
        """Install latest version of Miniconda via ContinuumIO's installer
        script on Ubuntu Xenial.
        """
        specs = {'pkg_manager': 'yum',
                 'check_urls': True,
                 'instructions': [
                    ('base', 'centos:7'),
                    ('miniconda', {
                        'python_version': '3.5.1',
                        'conda_install': ['traits'],
                        'pip_install': ['https://github.com/nipy/nipype/archive/master.tar.gz']
                    })
                 ]}
        container = utils.get_container_from_specs(specs)
        output = container.exec_run('python -V')
        assert "3.5.1" in output, "incorrect Python version"
        output = container.exec_run('import nipype')
        assert "ImportError" not in output, "nipype not installed"
        utils.test_cleanup(container)
<commit_msg>fix error in running a python command in docker container<commit_after>"""Tests for neurodocker.interfaces.Miniconda"""
# Author: <NAME> <<EMAIL>>
from __future__ import absolute_import, division, print_function

from neurodocker.interfaces import Miniconda
from neurodocker.interfaces.tests import utils

class TestMiniconda(object):
    """Tests for Miniconda class."""

    def test_build_image_miniconda_latest_shellscript_xenial(self):
        """Install latest version of Miniconda via ContinuumIO's installer
        script on Ubuntu Xenial.
        """
        specs = {'pkg_manager': 'yum',
                 'check_urls': True,
                 'instructions': [
                    ('base', 'centos:7'),
                    ('user', 'neuro')
                    ('miniconda', {
                        'python_version': '3.5.1',
                        'conda_install': ['traits'],
                        'pip_install': ['https://github.com/nipy/nipype/archive/master.tar.gz']
                    })
                 ]}
        container = utils.get_container_from_specs(specs)
        output = container.exec_run('python -V')
        assert "3.5.1" in output, "incorrect Python version"
        output = container.exec_run("python -c 'import nipype'")
        assert "ImportError" not in output, "nipype not installed"
        utils.test_cleanup(container)

{'fraction_non_alphanumeric': 0.11270801815431165, 'fraction_numerical': 0.00529500756429652, 'mean_word_length': 2.2614056720098645, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '666701', 'n_tokens_mistral': 758, 'n_tokens_neox': 717, 'n_words': 171}