Skip to content

Commit 0b5456e

Browse files
committed
Add acceptance test for managing Python 3
1 parent d114139 commit 0b5456e

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

spec/acceptance/class_spec.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff 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
1644
end

0 commit comments

Comments
 (0)