def collect_driver_disk_requirements_test(self): """Test the function collect_driver_disk_requirements.""" requirements = collect_driver_disk_requirements("/non/existent/file") self.assertEqual(requirements, []) r1 = self._create_requirement( name="p1", reason="Required by the driver updates disk.") r2 = self._create_requirement( name="p2", reason="Required by the driver updates disk.") r3 = self._create_requirement( name="p3", reason="Required by the driver updates disk.") with tempfile.NamedTemporaryFile(mode="w+t") as f: f.write("p1\np2 \np3 ") f.flush() requirements = collect_driver_disk_requirements(f.name) self._compare_requirements(requirements, [r1, r2, r3])
def _requirements(self): """Requirements for installing packages and groups. :return: a list of requirements """ return collect_remote_requirements() \ + collect_language_requirements(self._dnf_manager) \ + collect_platform_requirements(self._dnf_manager) \ + collect_driver_disk_requirements()