Skip to content

Commit

Permalink
Fixed issue with Exception message match in spec file.
Browse files Browse the repository at this point in the history
  • Loading branch information
randhircs committed Mar 3, 2025
1 parent ac29fea commit ab711d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
26 changes: 13 additions & 13 deletions python/spec/dependabot/python/file_parser/setup_file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,19 +255,19 @@
its(:length) { is_expected.to eq(12) }
end

# context "with an illformed_requirement" do
# let(:setup_cfg_file_fixture_name) { "illformed_req.cfg" }

# it "raises a helpful error" do
# expect { parser.dependency_set }
# .to raise_error do |error|
# expect(error.class)
# .to eq(Dependabot::DependencyFileNotEvaluatable)
# expect(error.message)
# .to include("InstallationError(\"Invalid requirement: 'psycopg2==2.6.1raven == 5.32.0'\")")
# end
# end
# end
context "with an illformed_requirement" do
let(:setup_cfg_file_fixture_name) { "illformed_req.cfg" }

it "raises a helpful error" do
expect { parser.dependency_set }
.to raise_error do |error|
expect(error.class)
.to eq(Dependabot::DependencyFileNotEvaluatable)
expect(error.message)
.to include("InstallationError(\"Invalid requirement: 'psycopg2==2.6.1raven == 5.32.0': Expected end or semicolon (after version specifier)\\n psycopg2==2.6.1raven == 5.32.0\\n ~~~~~~~~^\")") # rubocop:disable Layout/LineLength
end
end
end

context "with comments in the setup.cfg file" do
subject(:dependency) { dependencies.find { |d| d.name == "boto3" } }
Expand Down
1 change: 0 additions & 1 deletion python/spec/fixtures/setup_files/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ classifiers =
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
Expand Down

0 comments on commit ab711d6

Please sign in to comment.