|
1 | 1 | require 'spec_helper' |
2 | | - |
3 | 2 | describe 'python' do |
4 | 3 | on_supported_os.each do |os, facts| |
5 | 4 | next if os == 'gentoo-3-x86_64' |
|
240 | 239 | it { is_expected.to contain_package('python-dev').with_name('python36-devel') } |
241 | 240 | end |
242 | 241 | end |
| 242 | + |
| 243 | + describe 'with manage_gunicorn' do |
| 244 | + context 'true' do |
| 245 | + let(:params) { { manage_gunicorn: true } } |
| 246 | + |
| 247 | + it { is_expected.to contain_package('gunicorn').with_name('python-gunicorn') } |
| 248 | + end |
| 249 | + context 'empty args' do |
| 250 | + # let(:params) {{ :manage_gunicorn => '' }} |
| 251 | + it { is_expected.to contain_package('gunicorn').with_name('python-gunicorn') } |
| 252 | + end |
| 253 | + context 'false' do |
| 254 | + let(:params) { { manage_gunicorn: false } } |
| 255 | + |
| 256 | + it { is_expected.not_to contain_package('gunicorn') } |
| 257 | + end |
| 258 | + end |
| 259 | + |
| 260 | + describe 'with python::provider' do |
| 261 | + context 'scl' do |
| 262 | + describe 'with version' do |
| 263 | + context '3.6 SCL meta package' do |
| 264 | + let(:params) { { version: 'rh-python36' } } |
| 265 | + |
| 266 | + it { is_expected.to compile.with_all_deps } |
| 267 | + end |
| 268 | + context '3.6 SCL python package' do |
| 269 | + let(:params) { { version: 'rh-python36-python' } } |
| 270 | + |
| 271 | + it { is_expected.to compile.with_all_deps } |
| 272 | + end |
| 273 | + end |
| 274 | + describe 'with manage_scl' do |
| 275 | + context 'true' do |
| 276 | + let(:params) { { provider: 'scl', manage_scl: true } } |
| 277 | + |
| 278 | + it { is_expected.to contain_package('centos-release-scl') } |
| 279 | + it { is_expected.to contain_package('scl-utils') } |
| 280 | + end |
| 281 | + context 'false' do |
| 282 | + let(:params) { { provider: 'scl', manage_scl: false } } |
| 283 | + |
| 284 | + it { is_expected.not_to contain_package('centos-release-scl') } |
| 285 | + it { is_expected.not_to contain_package('scl-utils') } |
| 286 | + end |
| 287 | + end |
| 288 | + end |
| 289 | + end |
| 290 | + end |
| 291 | + when '8' |
| 292 | + context 'on a Redhat 8 OS' do |
| 293 | + it { is_expected.to contain_class('python::install') } |
| 294 | + it { is_expected.to contain_package('pip').with_name('python3-pip') } |
| 295 | + |
| 296 | + describe 'with python::version' do |
| 297 | + context 'python36' do |
| 298 | + let(:params) { { version: 'python36' } } |
| 299 | + |
| 300 | + it { is_expected.to compile.with_all_deps } |
| 301 | + it { is_expected.to contain_package('pip').with_name('python36-pip') } |
| 302 | + it { is_expected.to contain_package('python').with_name('python36') } |
| 303 | + it { is_expected.to contain_package('python-dev').with_name('python36-devel') } |
| 304 | + end |
| 305 | + end |
| 306 | + |
| 307 | + describe 'with manage_gunicorn' do |
| 308 | + context 'true' do |
| 309 | + let(:params) { { manage_gunicorn: true } } |
| 310 | + |
| 311 | + it { is_expected.to contain_package('gunicorn').with_name('python3-gunicorn') } |
| 312 | + end |
| 313 | + context 'empty args' do |
| 314 | + # let(:params) {{ :manage_gunicorn => '' }} |
| 315 | + it { is_expected.to contain_package('gunicorn').with_name('python3-gunicorn') } |
| 316 | + end |
| 317 | + context 'false' do |
| 318 | + let(:params) { { manage_gunicorn: false } } |
| 319 | + |
| 320 | + it { is_expected.not_to contain_package('gunicorn').with_name('python3-gunicorn') } |
| 321 | + end |
| 322 | + end |
| 323 | + |
243 | 324 | describe 'with python::provider' do |
244 | 325 | context 'scl' do |
245 | 326 | describe 'with version' do |
|
0 commit comments