File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,17 +10,48 @@ class { 'python':
1010 }
1111
1212 python::pip { 'agent package':
13- pkgname => 'agent'
14- ensure => '0.1.2'
13+ pkgname => 'agent',
14+ ensure => '0.1.2',
1515 }
1616 PUPPET
1717
1818 apply_manifest ( pp , catch_failures : true )
1919 apply_manifest ( pp , catch_changes : true )
2020 end
21+
2122 describe command ( '/usr/bin/pip list' ) do
2223 its ( :exit_status ) { is_expected . to eq 0 }
2324 its ( :stdout ) { is_expected . to match %r{agent.* 0\. 1\. 2} }
2425 end
26+
27+ context 'uninstall package with custom name' do
28+ it 'works with no errors' do
29+ pp = <<-PUPPET
30+ class { 'python':
31+ version => '3',
32+ dev => 'present',
33+ }
34+
35+ python::pip { 'agent package install':
36+ pkgname => 'agent',
37+ ensure => '0.1.2',
38+ }
39+
40+ python::pip { 'agent package uninstall':
41+ pkgname => 'agent',
42+ ensure => 'absent',
43+ require => Python::Pip['agent package install'],
44+ }
45+
46+ PUPPET
47+
48+ apply_manifest ( pp , catch_failures : true )
49+ apply_manifest ( pp , catch_changes : true )
50+ end
51+
52+ describe command ( '/usr/bin/pip list' ) do
53+ its ( :exit_status ) { is_expected . to eq 0 }
54+ its ( :stdout ) { is_expected . not_to match %r{agent.* 0\. 1\. 2} }
55+ end
2556end
2657
You can’t perform that action at this time.
0 commit comments