-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #607 from brabiega/patch-1
Use $real_pkgname for pip uninstall command
- Loading branch information
Showing
3 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'python::pip defined resource' do | ||
context 'install package with custom name' do | ||
it 'works with no errors' do | ||
pp = <<-PUPPET | ||
class { 'python': | ||
version => '3', | ||
dev => 'present', | ||
} | ||
python::pyvenv { '/opt/test-venv': | ||
ensure => 'present', | ||
systempkgs => false, | ||
mode => '0755', | ||
pip_version => '<= 20.3.4', | ||
} | ||
python::pip { 'agent package': | ||
virtualenv => '/opt/test-venv', | ||
pkgname => 'agent', | ||
ensure => '0.1.2', | ||
} | ||
PUPPET | ||
|
||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
end | ||
|
||
describe command('/opt/test-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 | ||
|
||
context 'uninstall package with custom name' do | ||
it 'works with no errors' do | ||
pp = <<-PUPPET | ||
class { 'python': | ||
version => '3', | ||
dev => 'present', | ||
} | ||
python::pyvenv { '/opt/test-venv': | ||
ensure => 'present', | ||
systempkgs => false, | ||
mode => '0755', | ||
pip_version => '<= 20.3.4', | ||
} | ||
python::pip { 'agent package install': | ||
ensure => '0.1.2', | ||
pkgname => 'agent', | ||
virtualenv => '/opt/test-venv', | ||
} | ||
python::pip { 'agent package uninstall custom pkgname': | ||
ensure => 'absent', | ||
pkgname => 'agent', | ||
virtualenv => '/opt/test-venv', | ||
require => Python::Pip['agent package install'], | ||
} | ||
PUPPET | ||
|
||
apply_manifest(pp, catch_failures: true) | ||
end | ||
end | ||
|
||
describe command('/opt/test-venv/bin/pip list') do | ||
its(:exit_status) { is_expected.to eq 0 } | ||
its(:stdout) { is_expected.not_to match %r{agent.* 0\.1\.2} } | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters