Exemplo n.º 1
0
def test_require_env():
    # Env creation without package list:
    assert conda.env_exists('require-env') == False
    require.conda.env('require-env')
    assert conda.env_exists('require-env')
    # Env creation with package list:
    assert conda.env_exists('require-env2') == False
    require.conda.env('require-env2', pkg_list=['python', 'six'])
    assert conda.env_exists('require-env2')
    with conda.env('require-env2'):
        assert conda.is_installed('six')
    # Requiring packages:
    with conda.env('require-env2'):
        assert conda.is_installed('redis') == False
        assert conda.is_installed('yaml') == False
        assert conda.is_installed('future') == False
        require.conda.package('redis')
        assert conda.is_installed('redis')
        require.conda.packages(['yaml', 'future'])
        assert conda.is_installed('yaml')
        assert conda.is_installed('future')
Exemplo n.º 2
0
def test_require_env():
    # Env creation without package list:
    assert conda.env_exists('require-env') == False
    require.conda.env('require-env')
    assert conda.env_exists('require-env')
    # Env creation with package list:
    assert conda.env_exists('require-env2') == False
    require.conda.env('require-env2', pkg_list=['python','six'])
    assert conda.env_exists('require-env2')
    with conda.env('require-env2'):
        assert conda.is_installed('six')
    # Requiring packages:
    with conda.env('require-env2'):
        assert conda.is_installed('redis') == False
        assert conda.is_installed('yaml') == False
        assert conda.is_installed('future') == False
        require.conda.package('redis')
        assert conda.is_installed('redis')
        require.conda.packages(['yaml','future'])
        assert conda.is_installed('yaml')
        assert conda.is_installed('future')
Exemplo n.º 3
0
def test_package_installation():
    conda.create_env('test3')
    with conda.env('test3'):
        assert conda.is_installed('six') == False
        conda.install('six')
        assert conda.is_installed('six')
Exemplo n.º 4
0
def test_package_installation():
    conda.create_env('test3')
    with conda.env('test3'):
        assert conda.is_installed('six') == False
        conda.install('six')
        assert conda.is_installed('six')