Skip to content

Commit

Permalink
squash: simplify generator
Browse files Browse the repository at this point in the history
  • Loading branch information
happz authored and psss committed Apr 10, 2024
1 parent ed099b9 commit 273c0bc
Showing 1 changed file with 7 additions and 32 deletions.
39 changes: 7 additions & 32 deletions tests/unit/test_package_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,47 +1102,22 @@ def _parametrize_test_install_filesystempath() -> Iterator[
None # noqa: E501

elif package_manager_class is tmt.package_managers.dnf.Dnf:
if 'centos:stream8' in container.url or 'fedora:rawhide' in container.url:
yield container, \
package_manager_class, \
FileSystemPath('/usr/bin/dos2unix'), \
r"rpm -q --whatprovides /usr/bin/dos2unix \|\| dnf install -y /usr/bin/dos2unix", \
'Installed:\n dos2unix-', \
None # noqa: E501

else:
yield container, \
package_manager_class, \
FileSystemPath('/usr/bin/dos2unix'), \
r"rpm -q --whatprovides /usr/bin/dos2unix \|\| dnf install -y /usr/bin/dos2unix", \
'Installed:\n dos2unix-', \
None # noqa: E501
yield container, \
package_manager_class, \
FileSystemPath('/usr/bin/dos2unix'), \
r"rpm -q --whatprovides /usr/bin/dos2unix \|\| dnf install -y /usr/bin/dos2unix", \
'Installed:\n dos2unix-', \
None # noqa: E501

elif package_manager_class is tmt.package_managers.dnf.Yum:
if 'centos:stream8' in container.url:
yield container, \
package_manager_class, \
FileSystemPath('/usr/bin/dos2unix'), \
r"rpm -q --whatprovides /usr/bin/dos2unix \|\| yum install -y /usr/bin/dos2unix && rpm -q --whatprovides /usr/bin/dos2unix", \
'Installed:\n dos2unix-', \
None # noqa: E501

elif 'centos:7' in container.url:
if 'centos:7' in container.url:
yield container, \
package_manager_class, \
FileSystemPath('/usr/bin/dos2unix'), \
r"rpm -q --whatprovides /usr/bin/dos2unix \|\| yum install -y /usr/bin/dos2unix && rpm -q --whatprovides /usr/bin/dos2unix", \
'Installed:\n dos2unix.', \
None # noqa: E501

elif 'fedora:rawhide' in container.url:
yield container, \
package_manager_class, \
FileSystemPath('/usr/bin/dos2unix'), \
r"rpm -q --whatprovides /usr/bin/dos2unix \|\| yum install -y /usr/bin/dos2unix && rpm -q --whatprovides /usr/bin/dos2unix", \
'Installed:\n dos2unix-', \
None # noqa: E501

else:
yield container, \
package_manager_class, \
Expand Down

0 comments on commit 273c0bc

Please sign in to comment.