Skip to content

Commit

Permalink
Acceptance test: works with editable=>true
Browse files Browse the repository at this point in the history
Improve formatting of existing tests
  • Loading branch information
mlow committed Jun 9, 2019
1 parent bc0cb6f commit e124fb5
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions spec/acceptance/virtualenv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ class { 'python' :
pip => 'present',
virtualenv => 'present',
}
->
python::virtualenv { 'venv' :
-> python::virtualenv { 'venv' :
ensure => 'present',
systempkgs => false,
venv_dir => '/opt/venv',
owner => 'root',
group => 'root',
}
->
python::pip { 'rpyc' :
-> python::pip { 'rpyc' :
ensure => '3.2.3',
virtualenv => '/opt/venv',
}
Expand All @@ -36,16 +34,14 @@ class { 'python' :
pip => 'present',
virtualenv => 'present',
}
->
python::virtualenv { 'venv' :
-> python::virtualenv { 'venv' :
ensure => 'present',
systempkgs => false,
venv_dir => '/opt/venv2',
owner => 'root',
group => 'root',
}
->
python::pip { 'pip' :
-> python::pip { 'pip' :
ensure => '18.0',
virtualenv => '/opt/venv2',
}
Expand All @@ -62,16 +58,14 @@ class { 'python' :
pip => 'present',
virtualenv => 'present',
}
->
python::virtualenv { 'venv' :
-> python::virtualenv { 'venv' :
ensure => 'present',
systempkgs => false,
venv_dir => '/opt/venv3',
owner => 'root',
group => 'root',
}
->
python::pip { 'rpyc' :
-> python::pip { 'rpyc' :
ensure => 'latest',
virtualenv => '/opt/venv3',
}
Expand All @@ -90,16 +84,14 @@ class { 'python' :
pip => 'present',
virtualenv => 'present',
}
->
python::virtualenv { 'venv' :
-> python::virtualenv { 'venv' :
ensure => 'present',
systempkgs => false,
venv_dir => '/opt/venv4',
owner => 'root',
group => 'root',
}
->
python::pip { 'Randomized_Requests' :
-> python::pip { 'Randomized_Requests' :
ensure => 'latest',
virtualenv => '/opt/venv4',
}
Expand All @@ -111,5 +103,34 @@ class { 'python' :
# but probability of this happening is minimal, so it should be acceptable.
apply_manifest(pp, catch_changes: true)
end
it 'works with editable=>true' do
pp = <<-EOS
package{ 'git' :
ensure => 'present',
}
-> class { 'python' :
version => 'system',
pip => 'present',
virtualenv => 'present',
}
-> python::virtualenv { 'venv' :
ensure => 'present',
systempkgs => false,
venv_dir => '/opt/venv5',
owner => 'root',
group => 'root',
}
-> python::pip { 'rpyc' :
ensure => '4.1.0',
url => 'git+https://github.com/tomerfiliba/rpyc.git',
editable => true,
virtualenv => '/opt/venv5',
}
EOS

# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
end
end

0 comments on commit e124fb5

Please sign in to comment.