Skip to content

Commit 26890f3

Browse files
committed
Fix unit tests
This commit fixes unit tests failing in CI Signed-off-by: Rohan Devasthale <[email protected]>
1 parent e679584 commit 26890f3

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

tests/test_sources.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def test_invalid_tarfile(mock_download_url: typing.Any, tmp_path: pathlib.Path)
2222
sources._download_source_check(req=req, destination_dir=fake_dir, url=fake_url)
2323

2424

25-
@patch("fromager.resolver.resolve")
25+
@patch("fromager.resolver.resolve_all")
2626
@patch("fromager.sources._download_source_check")
2727
def test_default_download_source_from_settings(
2828
download_source_check: Mock,
2929
resolve: Mock,
3030
testdata_context: context.WorkContext,
3131
) -> None:
32-
resolve.return_value = ("url", Version("42.1.2"))
32+
resolve.return_value = [("url", Version("42.1.2"))]
3333
download_source_check.return_value = pathlib.Path("filename.zip")
3434
req = Requirement("test_pkg==42.1.2")
3535
sdist_server_url = "https://sdist.test/egg"
@@ -62,7 +62,7 @@ def test_default_download_source_from_settings(
6262
)
6363

6464

65-
@patch("fromager.resolver.resolve")
65+
@patch("fromager.resolver.resolve_all")
6666
@patch("fromager.sources._download_source_check")
6767
@patch.multiple(
6868
packagesettings.PackageBuildInfo,
@@ -75,7 +75,7 @@ def test_default_download_source_with_predefined_resolve_dist(
7575
resolve: Mock,
7676
tmp_context: context.WorkContext,
7777
) -> None:
78-
resolve.return_value = ("url", Version("1.0"))
78+
resolve.return_value = [("url", Version("1.0"))]
7979
download_source_check.return_value = pathlib.Path("filename")
8080
req = Requirement("foo==1.0")
8181

@@ -92,16 +92,18 @@ def test_default_download_source_with_predefined_resolve_dist(
9292
)
9393

9494

95-
@patch("fromager.sources.default_resolve_source")
95+
@patch("fromager.sources.default_resolve_source_all")
9696
def test_invalid_version(
9797
mock_default_resolve_source: typing.Any, tmp_context: context.WorkContext
9898
) -> None:
9999
req = Requirement("fake==1.0")
100100
sdist_server_url = resolver.PYPI_SERVER_URL
101-
mock_default_resolve_source.return_value = (
102-
"fakesdisturl.com",
103-
"fake version 1.0",
104-
)
101+
mock_default_resolve_source.return_value = [
102+
(
103+
"fakesdisturl.com",
104+
"fake version 1.0",
105+
)
106+
]
105107
mock_default_resolve_source.__name__ = "mock_default_resolve_source"
106108
with pytest.raises(ValueError):
107109
sources.resolve_source(

0 commit comments

Comments
 (0)