diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-30 23:05:42 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-04-02 00:08:43 -0600 |
| commit | bfd7459419921ff37ee500f0698862eea6788675 (patch) | |
| tree | 9749333a7c8878b833b4642afe3071cf1c14012c /spec/integration/python/pip_spec.rb | |
| parent | 43bcbbd04342faa497725c5b0be3c6d944d850da (diff) | |
Reproduce failure with go modules scanning
* Install sudo for existing configurations
* Detect dependencies in a gomodules project
* Add CHANGELOG entry and bump version
* Symlink to $GOPATH for non go modules projects
* Remove problematic go get setup
Diffstat (limited to 'spec/integration/python/pip_spec.rb')
| -rw-r--r-- | spec/integration/python/pip_spec.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index d22121b..2183dd1 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -9,11 +9,10 @@ RSpec.describe "pip" do report = runner.scan - expect(report).not_to be_empty expect(report).to match_schema(version: '2.0') expect(report[:version]).to start_with('2') - expect(report[:dependencies].map { |x| x[:name] }).to include("sentry-sdk") - expect(find_in(report, 'sentry-sdk')[:licenses]).to match_array(["BSD-4-Clause"]) + expect(report.dependency_names).to include("sentry-sdk") + expect(report.licenses_for('sentry-sdk')).to match_array(["BSD-4-Clause"]) end end @@ -39,7 +38,6 @@ RSpec.describe "pip" do report = runner.scan - expect(report).not_to be_empty expect(report).to match_schema(version: '2.0') expect(report[:version]).to start_with('2') expect(report[:licenses]).not_to be_empty @@ -60,7 +58,7 @@ RSpec.describe "pip" do runner.clone(url, branch: python[:commit]) report = runner.scan(env: environment) - expect(JSON.pretty_generate(report)).to eq(expected_content) + expect(JSON.pretty_generate(report.to_h)).to eq(expected_content) expect(report).to match_schema(version: report_version) end end @@ -74,7 +72,7 @@ RSpec.describe "pip" do expect(report).to match_schema(version: '2.0') expect(report[:dependencies]).not_to be_empty - expect(find_in(report, 'boto3')[:licenses]).to match_array(['Apache-2.0']) + expect(report.licenses_for('boto3')).to match_array(['Apache-2.0']) end it 'detects licenses in a more complicated `setup.py`' do @@ -83,7 +81,7 @@ RSpec.describe "pip" do expect(report).to match_schema(version: '2.0') expect(report[:dependencies]).not_to be_empty - expect(find_in(report, 'peppercorn')[:licenses]).to match_array(['BSD-2-Clause']) + expect(report.licenses_for('peppercorn')).to match_array(['BSD-2-Clause']) end end @@ -96,7 +94,7 @@ RSpec.describe "pip" do report = runner.scan(env: { 'PIP_INDEX_URL' => 'https://test.pypi.org/simple/' }) expect(report).to match_schema(version: '2.0') - expect(find_in(report, 'six')[:licenses]).to match_array(["MIT"]) + expect(report.licenses_for('six')).to match_array(["MIT"]) end end @@ -109,8 +107,8 @@ RSpec.describe "pip" do report = runner.scan(env: { 'SETUP_CMD' => 'pip install -r requirements.txt' }) expect(report).to match_schema(version: '2.0') - expect(find_in(report, 'six')[:licenses]).to match_array(["MIT"]) - expect(report[:dependencies].map { |x| x[:name] }).to contain_exactly('six') + expect(report.licenses_for('six')).to match_array(["MIT"]) + expect(report.dependency_names).to contain_exactly('six') end end |
