File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 214214 # Latest version.
215215 exec { "pip_install_${name}" :
216216 command => " ${pip_env} wheel --help > /dev/null 2>&1 && { ${pip_env} wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { ${pip_env} --log ${log} /pip.log install --upgrade \$ wheel_support_flag ${proxy_flag} ${install_args} ${install_editable} ${source} || ${pip_env} --log ${log} /pip.log install --upgrade ${proxy_flag} ${install_args} ${install_editable} ${source} ;}" ,
217- unless => " ${pip_env} search ${source} | grep -i INSTALLED | grep -i latest" ,
217+ unless => " ${pip_env} search ${proxy_flag} ${ source} | grep -i INSTALLED | grep -i latest" ,
218218 user => $owner ,
219219 cwd => $cwd ,
220220 environment => $environment ,
Original file line number Diff line number Diff line change 3030 it { is_expected . to contain_exec ( "pip_install_rpyc" ) . with_cwd ( '/' ) }
3131 end
3232 end
33+
34+ describe "proxy as" do
35+ context "defaults to empty" do
36+ let ( :params ) { { } }
37+ it { is_expected . to contain_exec ( "pip_install_rpyc" ) . without_command ( /--proxy/ ) }
38+ end
39+ context "does not add proxy to search command if set to latest and proxy is unset" do
40+ let ( :params ) { { :ensure => 'latest' } }
41+ it { is_expected . to contain_exec ( "pip_install_rpyc" ) . without_command ( /--proxy/ ) }
42+ it { is_expected . to contain_exec ( "pip_install_rpyc" ) . without_unless ( /--proxy/ ) }
43+ end
44+ context "adds proxy to install command if proxy set" do
45+ let ( :params ) { { :proxy => "http://my.proxy:3128" } }
46+ it { is_expected . to contain_exec ( "pip_install_rpyc" ) . with_command ( "pip wheel --help > /dev/null 2>&1 && { pip wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { pip --log /tmp/pip.log install $wheel_support_flag --proxy=http://my.proxy:3128 rpyc || pip --log /tmp/pip.log install --proxy=http://my.proxy:3128 rpyc ;}" ) }
47+ end
48+ context "adds proxy to search command if set to latest" do
49+ let ( :params ) { { :proxy => "http://my.proxy:3128" , :ensure => 'latest' } }
50+ it { is_expected . to contain_exec ( "pip_install_rpyc" ) . with_command ( "pip wheel --help > /dev/null 2>&1 && { pip wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { pip --log /tmp/pip.log install --upgrade $wheel_support_flag --proxy=http://my.proxy:3128 rpyc || pip --log /tmp/pip.log install --upgrade --proxy=http://my.proxy:3128 rpyc ;}" ) }
51+ it { is_expected . to contain_exec ( "pip_install_rpyc" ) . with_unless ( 'pip search --proxy=http://my.proxy:3128 rpyc | grep -i INSTALLED | grep -i latest' ) }
52+ end
53+ end
54+
3355 end
3456end
You can’t perform that action at this time.
0 commit comments