diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-26 17:30:47 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-03-26 17:30:47 -0600 |
| commit | b12578a5f980501b585ffe5b45d8455bd33ddae8 (patch) | |
| tree | fb1f2e545a0be88db839d386f0c38eca3fa416c2 /spec/unit/python/source_spec.rb | |
| parent | dd34c1ebf4c53bb74e7d2ab64b42517563b6c9a1 (diff) | |
Fetch metadata from a different source
Diffstat (limited to 'spec/unit/python/source_spec.rb')
| -rw-r--r-- | spec/unit/python/source_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/unit/python/source_spec.rb b/spec/unit/python/source_spec.rb index 01bde3c..ccf63d3 100644 --- a/spec/unit/python/source_spec.rb +++ b/spec/unit/python/source_spec.rb @@ -15,4 +15,20 @@ RSpec.describe Spandx::Python::Source do end end end + + context "when fetching metadata for a known package from https://test.pypi.org" do + subject { described_class.new({ 'name' => 'pypi', 'url' => 'https://test.pypi.org/simple', 'verify_ssl' => true }) } + + it 'fetches the correct data' do + VCR.use_cassette('test.pypi/pip-18.1') do + result = subject.lookup('pip', '18.1') + + puts result.inspect + expect(result).not_to be_nil + expect(result['info']).not_to be_nil + expect(result['info']['name']).to eql('pip') + expect(result['info']['version']).to eql('18.1') + end + end + end end |
