From dd34c1ebf4c53bb74e7d2ab64b42517563b6c9a1 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 26 Mar 2020 17:12:18 -0600 Subject: Add spec for loading spec data from pypi.org --- spec/unit/python/source_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spec/unit/python/source_spec.rb (limited to 'spec/unit/python') diff --git a/spec/unit/python/source_spec.rb b/spec/unit/python/source_spec.rb new file mode 100644 index 0000000..01bde3c --- /dev/null +++ b/spec/unit/python/source_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +RSpec.describe Spandx::Python::Source do + context "when fetching metadata for a known package from https://pypi.org" do + subject { described_class.default } + + it 'fetches the correct data' do + VCR.use_cassette('pypi/pytest-5.4.1') do + result = subject.lookup('pytest', '5.4.1') + + expect(result).not_to be_nil + expect(result['info']).not_to be_nil + expect(result['info']['name']).to eql('pytest') + expect(result['info']['version']).to eql('5.4.1') + end + end + end +end -- cgit v1.2.3