Skip to content

Commit

Permalink
Failing spec for standard Python library updates
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Sep 29, 2022
1 parent d704d92 commit 3a8bddb
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
47 changes: 46 additions & 1 deletion python/spec/dependabot/python/update_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
its([:requirement]) { is_expected.to eq("==2.6.0") }
end

context "when there is a pyproject.toml file" do
context "when there is a pyproject.toml file with poetry dependencies" do
let(:dependency_files) { [requirements_file, pyproject] }
let(:pyproject_fixture_name) { "caret_version.toml" }

Expand Down Expand Up @@ -577,6 +577,51 @@
end
end

context "when there is a pyproject.toml file with pep621 dependencies" do
let(:dependency_files) { [pyproject] }
let(:pyproject_fixture_name) { "standard_python_caret_version.toml" }

let(:dependency) do
Dependabot::Dependency.new(
name: "requests",
version: "1.2.3",
requirements: [{
file: "pyproject.toml",
requirement: "~=1.0.0",
groups: [],
source: nil
}],
package_manager: "pip"
)
end

let(:pypi_url) { "https://pypi.org/simple/requests/" }
let(:pypi_response) do
fixture("pypi", "pypi_simple_response_requests.html")
end

context "for a library" do
before do
stub_request(:get, "https://pypi.org/pypi/pendulum/json/").
to_return(
status: 200,
body: fixture("pypi", "pypi_response_pendulum.json")
)
end

its([:requirement]) { is_expected.to eq(">=1,<3") }
end

context "for a non-library" do
before do
stub_request(:get, "https://pypi.org/pypi/pendulum/json/").
to_return(status: 404)
end

its([:requirement]) { is_expected.to eq("~=2.19.1") }
end
end

context "when there were multiple requirements" do
let(:dependency) do
Dependabot::Dependency.new(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
name = "pendulum"
version = "2.0.0"
homepage = "https://github.com/roghu/py3_projects"
license = "MIT"
readme = "README.md"
authors = ["Dependabot <support@dependabot.com>"]
description = "Python datetimes made easy"

dependencies = [
"python~=3.7",
"requests~=1.0.0"
]

0 comments on commit 3a8bddb

Please sign in to comment.