Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"6",
"7"
]
},
Expand Down
147 changes: 0 additions & 147 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,153 +223,6 @@
end
when 'RedHat', 'CentOS'
case facts[:os]['release']['major']
when '5'
# written for RHEL 5
context 'on a Redhat OS' do
it { is_expected.to contain_class('python::install') }
# Base debian packages.
it { is_expected.to contain_package('python') }
it { is_expected.to contain_package('python-dev').with_name('python-devel') }
it { is_expected.to contain_package('python-dev').with_alias('python-devel') }
it { is_expected.to contain_package('pip') }
it { is_expected.to contain_package('pip').with_name('python-pip') }
# Basic python packages (from pip)
it { is_expected.to contain_package('virtualenv') }

describe 'EPEL may be needed on EL' do
context 'default/empty' do
it { is_expected.to contain_class('epel') }
end
end

describe 'with python::dev' do
context 'true' do
let(:params) { { dev: 'present' } }

it { is_expected.to contain_package('python-dev').with_ensure('present') }
end
context 'empty/default' do
it { is_expected.to contain_package('python-dev').with_ensure('absent') }
end
end

describe 'with manage_gunicorn' do
context 'true' do
let(:params) { { manage_gunicorn: true } }

it { is_expected.to contain_package('gunicorn') }
end
context 'empty args' do
# let(:params) {{ :manage_gunicorn => '' }}
it { is_expected.to contain_package('gunicorn') }
end
context 'false' do
let(:params) { { manage_gunicorn: false } }

it { is_expected.not_to contain_package('gunicorn') }
end
end

describe 'with python::provider' do
context 'pip' do
let(:params) { { provider: 'pip' } }

it {
is_expected.to contain_package('virtualenv').with(
'provider' => 'pip'
)
}
it {
is_expected.to contain_package('pip').with(
'provider' => 'pip'
)
}
end

context 'anaconda' do
let(:params) { { provider: 'anaconda', anaconda_install_path: '/opt/test_path' } }

it {
is_expected.to contain_file('/var/tmp/anaconda_installer.sh')
is_expected.to contain_exec('install_anaconda_python').with_command('/var/tmp/anaconda_installer -b -p /opt/test_path')
is_expected.to contain_exec('install_anaconda_virtualenv').with_command('/opt/test_path/bin/pip install virtualenv')
}
end

# python::provider
context 'default' do
let(:params) { { provider: '' } }

it { is_expected.to contain_package('virtualenv') }
it { is_expected.to contain_package('pip') }

describe 'with python::virtualenv' do
context 'true' do
let(:params) { { provider: '', virtualenv: 'present' } }

it { is_expected.to contain_package('virtualenv').with_ensure('present') }
end
end

describe 'with python::virtualenv' do
context 'default/empty' do
let(:params) { { provider: '' } }

it { is_expected.to contain_package('virtualenv').with_ensure('absent') }
end
end
end
end

describe 'with python::dev' do
context 'true' do
let(:params) { { dev: 'present' } }

it { is_expected.to contain_package('python-dev').with_ensure('present') }
end
context 'default/empty' do
it { is_expected.to contain_package('python-dev').with_ensure('absent') }
end
end
end
when '6'

context 'on a Redhat 6 OS' do
it { is_expected.to contain_class('python::install') }
it { is_expected.to contain_package('pip').with_name('python-pip') }

describe 'with python::provider' do
context 'scl' do
describe 'with version' do
context '3.6 SCL meta package' do
let(:params) { { version: 'rh-python36' } }

it { is_expected.to compile.with_all_deps }
end
context '3.6 SCL python package' do
let(:params) { { version: 'rh-python36-python' } }

it { is_expected.to compile.with_all_deps }
end
end
describe 'with manage_scl' do
context 'true' do
let(:params) { { provider: 'scl', manage_scl: true } }

it { is_expected.to contain_package('centos-release-scl') }
it { is_expected.to contain_package('scl-utils') }
end
context 'false' do
let(:params) { { provider: 'scl', manage_scl: false } }

it { is_expected.not_to contain_package('centos-release-scl') }
it { is_expected.not_to contain_package('scl-utils') }
end
end
end
end
end

when '7'

context 'on a Redhat 7 OS' do
Expand Down