Fix setopt argument for install_weak_deps for microdnf
Micro DNF does not support "True"/"False", only "1"/"0"...
This commit is contained in:
parent
9c89d1fa00
commit
7ebeeca10b
@ -203,15 +203,15 @@ class PackageManagerMicroDnf(PackageManagerBase):
|
||||
"""
|
||||
Setup package processing only for required packages
|
||||
"""
|
||||
if '--setopt=install_weak_deps=False' not in self.custom_args:
|
||||
self.custom_args.append('--setopt=install_weak_deps=False')
|
||||
if '--setopt=install_weak_deps=0' not in self.custom_args:
|
||||
self.custom_args.append('--setopt=install_weak_deps=0')
|
||||
|
||||
def process_plus_recommended(self):
|
||||
"""
|
||||
Setup package processing to also include recommended dependencies.
|
||||
"""
|
||||
if '--setopt=install_weak_deps=False' in self.custom_args:
|
||||
self.custom_args.remove('--setopt=install_weak_deps=False')
|
||||
if '--setopt=install_weak_deps=0' in self.custom_args:
|
||||
self.custom_args.remove('--setopt=install_weak_deps=0')
|
||||
|
||||
def match_package_installed(self, package_name, dnf_output):
|
||||
"""
|
||||
|
||||
@ -117,14 +117,14 @@ class TestPackageManagerMicroDnf:
|
||||
|
||||
def test_process_only_required(self):
|
||||
self.manager.process_only_required()
|
||||
assert self.manager.custom_args == ['--setopt=install_weak_deps=False']
|
||||
assert self.manager.custom_args == ['--setopt=install_weak_deps=0']
|
||||
|
||||
def test_process_plus_recommended(self):
|
||||
self.manager.process_only_required()
|
||||
assert self.manager.custom_args == ['--setopt=install_weak_deps=False']
|
||||
assert self.manager.custom_args == ['--setopt=install_weak_deps=0']
|
||||
self.manager.process_plus_recommended()
|
||||
assert \
|
||||
'--setopt=install_weak_deps=False' not in self.manager.custom_args
|
||||
'--setopt=install_weak_deps=0' not in self.manager.custom_args
|
||||
|
||||
def test_match_package_installed(self):
|
||||
assert self.manager.match_package_installed('foo', 'Installing : foo')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user