Skip to content

Commit

Permalink
Set the destdir option
Browse files Browse the repository at this point in the history
  • Loading branch information
pkratoch committed Oct 29, 2024
1 parent 9d1dd54 commit 52e3428
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
13 changes: 10 additions & 3 deletions pyanaconda/modules/payloads/payload/dnf/dnf_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ def cost(self):
def cost(self, value):
self._config.get_cost_option().set(value)

@property
def destdir(self):
return self._config.get_destdir_option().get_value()

@destdir.setter
def destdir(self, value):
self._config.get_destdir_option().set(value)

@property
def excludepkgs(self):
return self._config.get_excludepkgs_option().get_value()
Expand Down Expand Up @@ -863,9 +871,8 @@ def set_download_location(self, path):
:param path: a path to the package directory
"""
# FIXME: Reimplement the assignment.
# for repo in self._base.repos.iter_enabled():
# repo.pkgdir = path
config = simplify_config(self._base.get_config())
config.destdir = path

self._download_location = path

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,18 +541,12 @@ def _install_packages_failed(self, base, transaction, progress):
"""Simulate the failed installation of packages."""
progress.error("The p1 package couldn't be installed!")

@pytest.mark.skip("Not implemented")
def test_set_download_location(self):
"""Test the set_download_location method."""
r1 = self._add_repo("r1")
r2 = self._add_repo("r2")
r3 = self._add_repo("r3")

self.dnf_manager.set_download_location("/my/download/location")

assert r1.pkgdir == "/my/download/location"
assert r2.pkgdir == "/my/download/location"
assert r3.pkgdir == "/my/download/location"
config = simplify_config(self.dnf_manager._base.get_config())
assert config.destdir == "/my/download/location"

def test_download_location(self):
"""Test the download_location property."""
Expand Down

0 comments on commit 52e3428

Please sign in to comment.