|
22 | 22 | it { is_expected.to contain_package("python-pip") } |
23 | 23 | # Basic python packages (from pip) |
24 | 24 | it { is_expected.to contain_package("python-virtualenv")} |
| 25 | + |
| 26 | + describe "with python::dev" do |
| 27 | + context "true" do |
| 28 | + let (:params) {{ :dev => true }} |
| 29 | + it { is_expected.to contain_package("python-dev").with( |
| 30 | + "ensure" => "present") |
| 31 | + } |
| 32 | + end |
| 33 | + context "empty/default" do |
| 34 | + it { is_expected.to contain_package("python-dev").with( |
| 35 | + "ensure" => "absent") |
| 36 | + } |
| 37 | + end |
| 38 | + end |
| 39 | + |
25 | 40 |
|
26 | 41 | describe "with manage_gunicorn" do |
27 | 42 | context "true" do |
28 | 43 | let (:params) {{ :manage_gunicorn => true }} |
29 | 44 | it { is_expected.to contain_package("gunicorn") } |
30 | 45 | end |
31 | | - end |
32 | | - describe "with manage_gunicorn" do |
33 | 46 | context "empty args" do |
34 | 47 | #let (:params) {{ :manage_gunicorn => '' }} |
35 | 48 | it { is_expected.to contain_package("gunicorn") } |
36 | 49 | end |
37 | | - end |
38 | | - |
39 | | - describe "without mange_gunicorn" do |
40 | 50 | context "false" do |
41 | 51 | let (:params) {{ :manage_gunicorn => false }} |
42 | 52 | it {is_expected.not_to contain_package("gunicorn")} |
43 | 53 | end |
44 | 54 | end |
45 | 55 |
|
| 56 | + describe "with python::provider" do |
| 57 | + context "pip" do |
| 58 | + let (:params) {{ :provider => 'pip' }} |
| 59 | + it { is_expected.to contain_package("virtualenv").with( |
| 60 | + "provider" => "pip" |
| 61 | + )} |
| 62 | + it { is_expected.to contain_package("pip").with( |
| 63 | + "provider" => "pip" |
| 64 | + )} |
| 65 | + end |
| 66 | + |
| 67 | + # python::provider |
| 68 | + context "default" do |
| 69 | + let (:params) {{ :provider => '' }} |
| 70 | + it { is_expected.to contain_package("python-virtualenv")} |
| 71 | + it { is_expected.to contain_package("python-pip")} |
| 72 | + |
| 73 | + describe "with python::virtualenv" do |
| 74 | + context "true" do |
| 75 | + let (:params) {{ |
| 76 | + :provider => '', |
| 77 | + :virtualenv => true |
| 78 | + }} |
| 79 | + it { is_expected.to contain_package("python-virtualenv").with( |
| 80 | + "ensure" => "present" |
| 81 | + )} |
| 82 | + end |
| 83 | + end |
| 84 | + |
| 85 | + describe "with python::virtualenv" do |
| 86 | + context "default/empty" do |
| 87 | + let (:params) {{ |
| 88 | + :provider => '', |
| 89 | + :virtualenv => '' |
| 90 | + }} |
| 91 | + it { is_expected.to contain_package("python-virtualenv").with( |
| 92 | + "ensure" => "absent" |
| 93 | + )} |
| 94 | + end |
| 95 | + end |
| 96 | + |
| 97 | + |
| 98 | + end |
| 99 | + end |
| 100 | + |
| 101 | + describe "with python::dev" do |
| 102 | + context "true" do |
| 103 | + let (:params) {{ :dev => true }} |
| 104 | + it { is_expected.to contain_package("python-dev").with( |
| 105 | + "ensure" => "present") |
| 106 | + } |
| 107 | + end |
| 108 | + context "default/empty" do |
| 109 | + let (:params) {{ :dev => '' }} |
| 110 | + it { is_expected.to contain_package("python-dev").with( |
| 111 | + "ensure" => "absent") |
| 112 | + } |
| 113 | + end |
| 114 | + |
46 | 115 | end |
47 | 116 |
|
48 | 117 | context "on a Redhat 5 OS" do |
|
64 | 133 | it { is_expected.to contain_package("python-pip") } |
65 | 134 | # Basic python packages (from pip) |
66 | 135 | it { is_expected.to contain_package("python-virtualenv")} |
| 136 | + |
| 137 | + describe "with python::dev" do |
| 138 | + context "true" do |
| 139 | + let (:params) {{ :dev => true }} |
| 140 | + it { is_expected.to contain_package("python-devel").with( |
| 141 | + "ensure" => "present") |
| 142 | + } |
| 143 | + end |
| 144 | + context "empty/default" do |
| 145 | + it { is_expected.to contain_package("python-devel").with( |
| 146 | + "ensure" => "absent") |
| 147 | + } |
| 148 | + end |
| 149 | + end |
| 150 | + |
| 151 | + |
| 152 | + describe "with manage_gunicorn" do |
| 153 | + context "true" do |
| 154 | + let (:params) {{ :manage_gunicorn => true }} |
| 155 | + it { is_expected.to contain_package("gunicorn") } |
| 156 | + end |
| 157 | + context "empty args" do |
| 158 | + #let (:params) {{ :manage_gunicorn => '' }} |
| 159 | + it { is_expected.to contain_package("gunicorn") } |
| 160 | + end |
| 161 | + context "false" do |
| 162 | + let (:params) {{ :manage_gunicorn => false }} |
| 163 | + it {is_expected.not_to contain_package("gunicorn")} |
| 164 | + end |
| 165 | + end |
67 | 166 |
|
68 | | - end |
| 167 | + describe "with python::provider" do |
| 168 | + context "pip" do |
| 169 | + let (:params) {{ :provider => 'pip' }} |
| 170 | + it { is_expected.to contain_package("virtualenv").with( |
| 171 | + "provider" => "pip" |
| 172 | + )} |
| 173 | + it { is_expected.to contain_package("pip").with( |
| 174 | + "provider" => "pip" |
| 175 | + )} |
| 176 | + end |
| 177 | + |
| 178 | + # python::provider |
| 179 | + context "default" do |
| 180 | + let (:params) {{ :provider => '' }} |
| 181 | + it { is_expected.to contain_package("python-virtualenv")} |
| 182 | + it { is_expected.to contain_package("python-pip")} |
| 183 | + |
| 184 | + describe "with python::virtualenv" do |
| 185 | + context "true" do |
| 186 | + let (:params) {{ |
| 187 | + :provider => '', |
| 188 | + :virtualenv => true |
| 189 | + }} |
| 190 | + it { is_expected.to contain_package("python-virtualenv").with( |
| 191 | + "ensure" => "present" |
| 192 | + )} |
| 193 | + end |
| 194 | + end |
| 195 | + |
| 196 | + describe "with python::virtualenv" do |
| 197 | + context "default/empty" do |
| 198 | + let (:params) {{ |
| 199 | + :provider => '', |
| 200 | + :virtualenv => '' |
| 201 | + }} |
| 202 | + it { is_expected.to contain_package("python-virtualenv").with( |
| 203 | + "ensure" => "absent" |
| 204 | + )} |
| 205 | + end |
| 206 | + end |
69 | 207 |
|
| 208 | + |
| 209 | + end |
| 210 | + end |
| 211 | + |
| 212 | + describe "with python::dev" do |
| 213 | + context "true" do |
| 214 | + let (:params) {{ :dev => true }} |
| 215 | + it { is_expected.to contain_package("python-devel").with( |
| 216 | + "ensure" => "present") |
| 217 | + } |
| 218 | + end |
| 219 | + context "default/empty" do |
| 220 | + let (:params) {{ :dev => '' }} |
| 221 | + it { is_expected.to contain_package("python-devel").with( |
| 222 | + "ensure" => "absent") |
| 223 | + } |
| 224 | + end |
| 225 | + end |
| 226 | + end |
| 227 | + end |
70 | 228 | end |
0 commit comments