Skip to content

Commit

Permalink
enhance pyvenv tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Dec 7, 2020
1 parent 54ca822 commit 8e3ae07
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions spec/acceptance/pyvenv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,45 @@ class { 'python':
apply_manifest(pp, catch_changes: true)
end
end

context 'with versioned minimal python::pip and without systempkgs' do
it 'works with no errors' do
pp = <<-PUPPET
class { 'python':
version => '3',
dev => 'present',
}
user { 'agent':
ensure => 'present',
managehome => true,
home => '/opt/agent',
}
group { 'agent':
ensure => 'present',
system => true,
}
python::pyvenv { '/opt/agent/venv':
ensure => 'present',
systempkgs => false,
owner => 'agent',
group => 'agent',
mode => '0755',
}
python::pip { 'agent' :
ensure => '0.1.2',
virtualenv => '/opt/agent/venv',
owner => 'agent',
group => 'agent',
}
PUPPET

# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
describe command('/opt/agent/venv/bin/pip list') do
its(:exit_status) { is_expected.to eq 0 }
its(:stdout) { is_expected.to match %r{agent.* 0\.1\.2} }
end
end
end

0 comments on commit 8e3ae07

Please sign in to comment.