Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt: improve doc+test for get_remote_versions_for_package #2813

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions uaclient/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ def get_remote_versions_for_package(
valid_origins = [
file
for file, _ in version.file_list
# component == now means we are getting it from the local dpkg
# cache, and we don't really care about those entries because
# they are the currently installed version of the package.
if file.component != "now" and file.origin != exclude_origin
]
if valid_origins:
Expand Down
4 changes: 3 additions & 1 deletion uaclient/tests/test_apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,9 @@ def test_get_remote_versions_excluding_origin(self):
get_remote_versions_for_package(
mock_package(
"name",
installed_version=mock_version("1.0"),
installed_version=mock_version(
"1.0", [mock_origin("now", "", "Origin1", "")]
),
other_versions=[
mock_version(
"0.9", [mock_origin("", "", "Origin1", "")]
Expand Down
Loading