diff options
| author | mo khan <mo.khan@gmail.com> | 2020-08-21 19:07:16 +0000 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-08-21 19:07:16 +0000 |
| commit | eb11eeb1018c4d32e8dbaf3f734e588205f0671f (patch) | |
| tree | e0595b6d9b1ad9f85969b1c304613420e777b993 /spec/integration/python | |
| parent | 366fbf58b1334f771e76b313dac58f568a420e0e (diff) | |
| parent | 50a62393fe6ba477deb224480a2133482238754e (diff) | |
Merge branch '207904-bsd-not-precise' into 'master'v3.24.0
Denormalize BSD-4-Clause license
See merge request gitlab-org/security-products/license-management!196
Diffstat (limited to 'spec/integration/python')
| -rw-r--r-- | spec/integration/python/pip_spec.rb | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index 9c2721d..9911dc5 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -14,7 +14,7 @@ RSpec.describe "pip" do expect(report).to match_schema expect(report[:version]).to start_with('2') expect(report.dependency_names).to include("sentry-sdk") - expect(report.licenses_for('sentry-sdk')).to match_array(["BSD-4-Clause"]) + expect(report.licenses_for('sentry-sdk')).to match_array(["bsd"]) end end @@ -46,6 +46,22 @@ RSpec.describe "pip" do end end + context 'with BSD licenses dependencies' do + let(:requirements) { %w[webencodings idna click EasyProcess PyVirtualDisplay].join("\n") } + + it 'finds proper versions of BSD license' do + runner.add_file('requirements.txt', requirements) + + report = runner.scan + + expect(report.licenses_for('webencodings')).to eq(['bsd']) + expect(report.licenses_for('idna')).to eq(['bsd-like']) + expect(report.licenses_for('EasyProcess')).to eq(['bsd']) + expect(report.licenses_for('PyVirtualDisplay')).to eq(['bsd']) + expect(report.licenses_for('click')).to eq(['BSD-3-Clause']) + end + end + [{ version: '2', commit: '04dce91b' }, { version: '3', commit: '48e250a1' }].each do |python| ['1.0', '1.1', '2.0', '2.1'].each do |report_version| context "when generating a `#{report_version}` report using Python `#{python[:version]}`" do @@ -148,14 +164,14 @@ RSpec.describe "pip" 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'], -) + 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 @@ -178,9 +194,9 @@ setup( before do runner.add_file('custom.sh') do <<~SCRIPT - #!/bin/bash -l + #!/bin/bash -l - python --version &> '#{output_file}' + python --version &> '#{output_file}' SCRIPT end end |
