|
61 | 61 |
|
62 | 62 | # python::provider |
63 | 63 | context "default" do |
64 | | - let (:params) {{ :provider => '' }} |
| 64 | + let (:params) {{ :provider => '' }} |
65 | 65 | it { is_expected.to contain_package("python-virtualenv")} |
66 | 66 | it { is_expected.to contain_package("python-pip")} |
67 | 67 |
|
|
181 | 181 | end |
182 | 182 | end |
183 | 183 | end |
184 | | -end |
| 184 | + |
| 185 | + context "on a SLES 11 SP3" do |
| 186 | + let :facts do |
| 187 | + { |
| 188 | + :id => 'root', |
| 189 | + :kernel => 'Linux', |
| 190 | + :osfamily => 'Suse', |
| 191 | + :operatingsystem => 'SLES', |
| 192 | + :operatingsystemrelease => '11.3', |
| 193 | + :concat_basedir => '/dne', |
| 194 | + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', |
| 195 | + } |
| 196 | + end |
| 197 | + it { is_expected.to contain_class("python::install") } |
| 198 | + # Base Suse packages. |
| 199 | + it { is_expected.to contain_package("python") } |
| 200 | + it { is_expected.to contain_package("python-devel") } |
| 201 | + it { is_expected.to contain_package("python-pip") } |
| 202 | + # Basic python packages (from pip) |
| 203 | + it { is_expected.to contain_package("python-virtualenv")} |
| 204 | + |
| 205 | + describe "with python::dev" do |
| 206 | + context "true" do |
| 207 | + let (:params) {{ :dev => true }} |
| 208 | + it { is_expected.to contain_package("python-devel").with_ensure('present') } |
| 209 | + end |
| 210 | + context "empty/default" do |
| 211 | + it { is_expected.to contain_package("python-devel").with_ensure('absent') } |
| 212 | + end |
| 213 | + end |
| 214 | + |
| 215 | + describe "with manage_gunicorn" do |
| 216 | + context "true" do |
| 217 | + let (:params) {{ :manage_gunicorn => true }} |
| 218 | + it { is_expected.to contain_package("gunicorn") } |
| 219 | + end |
| 220 | + context "empty args" do |
| 221 | + #let (:params) {{ :manage_gunicorn => '' }} |
| 222 | + it { is_expected.to contain_package("gunicorn") } |
| 223 | + end |
| 224 | + context "false" do |
| 225 | + let (:params) {{ :manage_gunicorn => false }} |
| 226 | + it {is_expected.not_to contain_package("gunicorn")} |
| 227 | + end |
| 228 | + end |
| 229 | + |
| 230 | + describe "with python::provider" do |
| 231 | + context "pip" do |
| 232 | + let (:params) {{ :provider => 'pip' }} |
| 233 | + |
| 234 | + it { is_expected.to contain_package("virtualenv").with( |
| 235 | + 'provider' => 'pip' |
| 236 | + )} |
| 237 | + it { is_expected.to contain_package("pip").with( |
| 238 | + 'provider' => 'pip' |
| 239 | + )} |
| 240 | + end |
| 241 | + |
| 242 | + # python::provider |
| 243 | + context "default" do |
| 244 | + let (:params) {{ :provider => '' }} |
| 245 | + it { is_expected.to contain_package("python-virtualenv")} |
| 246 | + it { is_expected.to contain_package("python-pip")} |
| 247 | + |
| 248 | + describe "with python::virtualenv" do |
| 249 | + context "true" do |
| 250 | + let (:params) {{ :provider => '', :virtualenv => true }} |
| 251 | + it { is_expected.to contain_package("python-virtualenv").with_ensure('present') } |
| 252 | + end |
| 253 | + end |
| 254 | + |
| 255 | + describe "with python::virtualenv" do |
| 256 | + context "default/empty" do |
| 257 | + let (:params) {{ :provider => '' }} |
| 258 | + it { is_expected.to contain_package("python-virtualenv").with_ensure('absent') } |
| 259 | + end |
| 260 | + end |
| 261 | + end |
| 262 | + end |
| 263 | + |
| 264 | + describe "with python::dev" do |
| 265 | + context "true" do |
| 266 | + let (:params) {{ :dev => true }} |
| 267 | + it { is_expected.to contain_package("python-devel").with_ensure('present') } |
| 268 | + end |
| 269 | + context "default/empty" do |
| 270 | + it { is_expected.to contain_package("python-devel").with_ensure('absent') } |
| 271 | + end |
| 272 | + end |
| 273 | + end |
| 274 | +end |
0 commit comments