|
272 | 272 | end |
273 | 273 | end |
274 | 274 | end |
| 275 | + |
| 276 | + context "on a Gentoo OS" do |
| 277 | + let :facts do |
| 278 | + { |
| 279 | + :id => 'root', |
| 280 | + :kernel => 'Linux', |
| 281 | + :lsbdistcodename => 'n/a', |
| 282 | + :osfamily => 'Gentoo', |
| 283 | + :operatingsystem => 'Gentoo', |
| 284 | + :concat_basedir => '/dne', |
| 285 | + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', |
| 286 | + } |
| 287 | + end |
| 288 | + it { is_expected.to contain_class("python::install") } |
| 289 | + # Base debian packages. |
| 290 | + it { is_expected.to contain_package("python") } |
| 291 | + it { is_expected.to contain_package("pip").with({"category" => "dev-python"}) } |
| 292 | + # Basic python packages (from pip) |
| 293 | + it { is_expected.to contain_package("virtualenv")} |
| 294 | + # Python::Dev |
| 295 | + it { is_expected.not_to contain_package("python-dev") } |
| 296 | + |
| 297 | + describe "with manage_gunicorn" do |
| 298 | + context "true" do |
| 299 | + let (:params) {{ :manage_gunicorn => true }} |
| 300 | + it { is_expected.to contain_package("gunicorn") } |
| 301 | + end |
| 302 | + context "empty args" do |
| 303 | + #let (:params) {{ :manage_gunicorn => '' }} |
| 304 | + it { is_expected.to contain_package("gunicorn") } |
| 305 | + end |
| 306 | + context "false" do |
| 307 | + let (:params) {{ :manage_gunicorn => false }} |
| 308 | + it {is_expected.not_to contain_package("gunicorn")} |
| 309 | + end |
| 310 | + end |
| 311 | + |
| 312 | + describe "with python::provider" do |
| 313 | + context "pip" do |
| 314 | + let (:params) {{ :provider => 'pip' }} |
| 315 | + |
| 316 | + it { is_expected.to contain_package("virtualenv").with( |
| 317 | + 'provider' => 'pip' |
| 318 | + )} |
| 319 | + it { is_expected.to contain_package("pip").with( |
| 320 | + 'provider' => 'pip' |
| 321 | + )} |
| 322 | + end |
| 323 | + |
| 324 | + # python::provider |
| 325 | + context "default" do |
| 326 | + let (:params) {{ :provider => '' }} |
| 327 | + it { is_expected.to contain_package("virtualenv")} |
| 328 | + it { is_expected.to contain_package("pip")} |
| 329 | + |
| 330 | + describe "with python::virtualenv" do |
| 331 | + context "true" do |
| 332 | + let (:params) {{ :provider => '', :virtualenv => 'present' }} |
| 333 | + it { is_expected.to contain_package("virtualenv").with_ensure('present') } |
| 334 | + end |
| 335 | + end |
| 336 | + |
| 337 | + describe "with python::virtualenv" do |
| 338 | + context "default/empty" do |
| 339 | + let (:params) {{ :provider => '' }} |
| 340 | + it { is_expected.to contain_package("virtualenv").with_ensure('absent') } |
| 341 | + end |
| 342 | + end |
| 343 | + end |
| 344 | + end |
| 345 | + end |
| 346 | + |
275 | 347 | end |
0 commit comments