diff options
| author | mo khan <mo.khan@gmail.com> | 2020-04-09 16:05:28 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-04-09 16:39:08 -0600 |
| commit | 04e57e76844d7ca70d5b1a84d9b30dba1d6bee9c (patch) | |
| tree | 05f9cf6e795b8acb54f8b7df87972588bfa38a23 /spec/integration/python/pip_spec.rb | |
| parent | dda9e59a4a3ab471001998d0e68d67ab12b4ac69 (diff) | |
Specify PIP_CERT when installing pip packages
* Add CHANGELOG entry
* Move method `default_env` to Python class
Diffstat (limited to 'spec/integration/python/pip_spec.rb')
| -rw-r--r-- | spec/integration/python/pip_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index 2183dd1..b78f8a2 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -127,4 +127,35 @@ RSpec.describe "pip" do expect(report[:dependencies]).to be_empty end end + + context "when connecting to a private package repository with self signed certificate" do + let(:index_url) { "https://#{private_pypi_host}/simple" } + let(:bundle) { fixture_file_content('python/pypi.crt') } + + before do + runner.add_file('setup.py') do + <<~RAW +from setuptools import setup, find_packages + +setup( + name='gitlab-sp-test-python-pip', + version='1.2.0', + packages=find_packages(), + install_requires=['requests'], +) + RAW + end + end + + it 'downloads the packages and trusts the certificate' do + report = runner.scan(env: { + 'ADDITIONAL_CA_CERT_BUNDLE' => bundle, + 'PIP_INDEX_URL' => index_url + }) + + expect(report).to match_schema(version: '2.0') + expect(report.dependency_names).to include('requests') + expect(report.licenses_for('requests')).to match_array(['Apache-2.0']) + end + end end |
