File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,4 +13,32 @@ class { 'python': }
1313 apply_manifest ( pp , catch_changes : true )
1414 end
1515 end
16+ context 'installing python 3' do
17+ # Using puppet_apply as a helper
18+ it 'works with no errors' do
19+ pp = <<-EOS
20+ class { 'python':
21+ ensure => 'present',
22+ version => '3',
23+ pip => 'present',
24+ dev => 'present',
25+ virtualenv => 'present',
26+ }
27+ EOS
28+
29+ # Run it twice and test for idempotency
30+ apply_manifest ( pp , catch_failures : true )
31+ apply_manifest ( pp , catch_changes : true )
32+ end
33+ fact_notices = <<-EOS
34+ notify{"pip_version: ${facts['pip3_version']}":}
35+ notify{"python_version: ${facts['python3_version']}":}
36+ EOS
37+ it 'outputs python facts when not installed' do
38+ apply_manifest ( fact_notices , catch_failures : true ) do |r |
39+ expect ( r . stdout ) . to match ( %r{python_version: 3\. \S +} )
40+ expect ( r . stdout ) . to match ( %r{pip_version: \S +} )
41+ end
42+ end
43+ end
1644end
You can’t perform that action at this time.
0 commit comments