File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -143,4 +143,46 @@ class { 'python':
143143 apply_manifest ( pp , catch_changes : true )
144144 end
145145 end
146+
147+ context 'with versioned minimal python::pip and without systempkgs' do
148+ it 'works with no errors' do
149+ pp = <<-PUPPET
150+ class { 'python':
151+ version => '3',
152+ dev => 'present',
153+ }
154+ user { 'agent':
155+ ensure => 'present',
156+ managehome => true,
157+ home => '/opt/agent',
158+ }
159+ group { 'agent':
160+ ensure => 'present',
161+ system => true,
162+ }
163+ python::pyvenv { '/opt/agent/venv':
164+ ensure => 'present',
165+ systempkgs => false,
166+ owner => 'agent',
167+ group => 'agent',
168+ mode => '0755',
169+ }
170+ python::pip { 'agent' :
171+ ensure => '0.1.2',
172+ virtualenv => '/opt/agent/venv',
173+ owner => 'agent',
174+ group => 'agent',
175+ }
176+ PUPPET
177+
178+ # Run it twice and test for idempotency
179+ apply_manifest ( pp , catch_failures : true )
180+ apply_manifest ( pp , catch_changes : true )
181+ end
182+
183+ describe command ( '/opt/agent/venv/bin/pip list' ) do
184+ its ( :exit_status ) { is_expected . to eq 0 }
185+ its ( :stdout ) { is_expected . to match %r{agent.* 0\. 1\. 2} }
186+ end
187+ end
146188end
You can’t perform that action at this time.
0 commit comments