From e124fb519e97ee30625df610b1a680bd2d8d5275 Mon Sep 17 00:00:00 2001 From: Matt Low Date: Sun, 9 Jun 2019 23:25:50 +0400 Subject: [PATCH] Acceptance test: works with editable=>true Improve formatting of existing tests --- spec/acceptance/virtualenv_spec.rb | 53 +++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/spec/acceptance/virtualenv_spec.rb b/spec/acceptance/virtualenv_spec.rb index 4e4e4529..5bbb6dbd 100644 --- a/spec/acceptance/virtualenv_spec.rb +++ b/spec/acceptance/virtualenv_spec.rb @@ -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', } @@ -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', } @@ -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', } @@ -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', } @@ -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