blob: f8144f3dc8f04817194077c50f2a7f0e4959377d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
require_relative '../../spec_helper'
describe 'python::requirements', :type => :define do
let (:title) { '/requirements.txt' }
context "on Debian OS" do
let :facts do
{
:id => 'root',
:kernel => 'Linux',
:lsbdistcodename => 'squeeze',
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:concat_basedir => '/dne',
}
end
describe "requirements as" do
context "/requirements.txt" do
let (:params) {{ :requirements => "/requirements.txt" }}
it { is_expected.to contain_file("/requirements.txt").with(
"mode" => "0644"
)}
end
describe "with owner" do
context "bob:bob" do
let (:params) {{
:owner => 'bob',
:group => 'bob'
}}
it do
expect {
should compile
}.to raise_error(Puppet::Error, /root user must be used when virtualenv is system/)
end
end
end
describe "with owner" do
context "default" do
it { is_expected.to contain_file("/requirements.txt").with(
"owner" => "root",
"group" => "root"
)}
end
end
end
end
end
|