Skip to content

Commit f41f1e7

Browse files
committed
enhance pyvenv tests
1 parent 54ca822 commit f41f1e7

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

spec/acceptance/pyvenv_spec.rb

+42
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,46 @@ class { 'python':
143143
apply_manifest(pp, catch_changes: true)
144144
end
145145
end
146+
context 'with versioned minimal python::pip and without systempkgs' do
147+
it 'works with no errors' do
148+
pp = <<-PUPPET
149+
class { 'python':
150+
version => '3',
151+
dev => 'present',
152+
}
153+
user { 'agent':
154+
ensure => 'present',
155+
managehome => true,
156+
home => '/opt/agent',
157+
}
158+
group { 'agent':
159+
ensure => 'present',
160+
system => true,
161+
}
162+
python::pyvenv { '/opt/agent/venv':
163+
ensure => 'present',
164+
systempkgs => false,
165+
owner => 'agent',
166+
group => 'agent',
167+
mode => '0755',
168+
}
169+
python::pip { 'agent' :
170+
ensure => '0.1.2',
171+
virtualenv => '/opt/agent/venv',
172+
owner => 'agent',
173+
group => 'agent',
174+
}
175+
PUPPET
176+
177+
# Run it twice and test for idempotency
178+
apply_manifest(pp, catch_failures: true)
179+
apply_manifest(pp, catch_changes: true)
180+
end
181+
it 'lists the installed agent' do
182+
shell('/opt/agent/venv/bin/pip list') do |r|
183+
r.stdout.should =~ %r{agent 0.1.2}
184+
r.exit_code.should be_zero
185+
end
186+
end
187+
end
146188
end

0 commit comments

Comments
 (0)