-
-
Notifications
You must be signed in to change notification settings - Fork 376
Expand file tree
/
Copy pathpyvenv_spec.rb
More file actions
45 lines (39 loc) · 1.39 KB
/
pyvenv_spec.rb
File metadata and controls
45 lines (39 loc) · 1.39 KB
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
require 'spec_helper'
describe 'python::pyvenv', type: :define do
on_supported_os.each do |os, facts|
next if os == 'gentoo-3-x86_64'
context "on #{os}" do
let :facts do
# python3 is required to use pyvenv
facts.merge(
python3_version: '3.5.1'
)
end
let :title do
'/opt/env'
end
context 'with default parameters' do
it { is_expected.to contain_file('/opt/env') }
it { is_expected.to contain_exec('python_virtualenv_/opt/env').with_command('pyvenv-3.5 --clear /opt/env && /opt/env/bin/pip --log /opt/env/pip.log install --upgrade pip && /opt/env/bin/pip --log /opt/env/pip.log install --upgrade setuptools') }
if %w[xenial cosmic disco stretch].include?(facts[:lsbdistcodename])
it { is_expected.to contain_package('python3.5-venv').that_comes_before('File[/opt/env]') }
end
if %w[bionic buster].include?(facts[:lsbdistcodename])
it { is_expected.to contain_package('python3-venv').that_comes_before('File[/opt/env]') }
end
end
describe 'when ensure' do
context 'is absent' do
let :params do
{
ensure: 'absent'
}
end
it {
is_expected.to contain_file('/opt/env').with_ensure('absent').with_purge(true)
}
end
end
end # context
end
end