def get_installation_specs_environment_test(self): """Test the get_installation_specs function with environment.""" data = PackagesSelectionData() data.environment = "environment-1" self.assertEqual(get_installation_specs(data), (["@environment-1", "@core"], [])) env = "environment-2" self.assertEqual(get_installation_specs(data, default_environment=env), (["@environment-1", "@core"], [])) data.default_environment_enabled = True self.assertEqual(get_installation_specs(data, default_environment=env), (["@environment-2", "@core"], []))
def test_get_installation_specs_environment(self): """Test the get_installation_specs function with environment.""" data = PackagesSelectionData() data.environment = "environment-1" assert get_installation_specs(data) == (["@environment-1", "@core"], []) env = "environment-2" assert get_installation_specs( data, default_environment=env) == (["@environment-1", "@core"], []) data.default_environment_enabled = True assert get_installation_specs( data, default_environment=env) == (["@environment-2", "@core"], [])
def get_installation_specs_groups_test(self): """Test the get_installation_specs function with groups.""" data = self._get_data() create_group = data.packages.create_group data.packages.groupList = [ create_group("g1", include=GROUP_REQUIRED), create_group("g2", include=GROUP_DEFAULT), create_group("g3", include=GROUP_ALL), ] data.packages.excludedGroupList = [ create_group("g4", include=GROUP_REQUIRED), create_group("g5", include=GROUP_DEFAULT), create_group("g6", include=GROUP_ALL), ] self.assertEqual(get_installation_specs(data), ( [ "@core", "@g1/mandatory,conditional", "@g2", "@g3/mandatory,default,conditional,optional"], [ "@g4", "@g5", "@g6" ] ))
def get_installation_specs_groups_test(self): """Test the get_installation_specs function with groups.""" data = PackagesSelectionData() data.groups = ["g1", "g2", "g3"] data.excluded_groups = ["g4", "g5", "g6"] data.groups_package_types = { "g1": GROUP_PACKAGE_TYPES_REQUIRED, "g3": GROUP_PACKAGE_TYPES_ALL, "g4": GROUP_PACKAGE_TYPES_REQUIRED, "g6": GROUP_PACKAGE_TYPES_ALL, } self.assertEqual(get_installation_specs(data), ( [ "@core", "@g1/mandatory,conditional", "@g2", "@g3/mandatory,default,conditional,optional"], [ "@g4", "@g5", "@g6" ] ))
def test_get_installation_specs_packages(self): """Test the get_installation_specs function with packages.""" data = PackagesSelectionData() data.packages = ["p1", "p2", "p3"] data.excluded_packages = ["p4", "p5", "p6"] assert get_installation_specs(data) == (["@core", "p1", "p2", "p3"], ["p4", "p5", "p6"])
def get_installation_specs_packages_test(self): """Test the get_installation_specs function with packages.""" data = PackagesSelectionData() data.packages = ["p1", "p2", "p3"] data.excluded_packages = ["p4", "p5", "p6"] self.assertEqual(get_installation_specs(data), (["@core", "p1", "p2", "p3"], ["p4", "p5", "p6"]))
def _collect_selected_specs(self): """Collect specs for the selected software.""" log.debug("Collecting selected specs.") # Get the default environment. default_environment = self._dnf_manager.default_environment # Get the installation specs. include_list, exclude_list = get_installation_specs( self._selection, default_environment) self._include_list.extend(include_list) self._exclude_list.extend(exclude_list)
def get_installation_specs_nocore_test(self): """Test the get_installation_specs function without core.""" data = self._get_data() data.packages.nocore = True self.assertEqual(get_installation_specs(data), ([], ["@core"]))
def get_installation_specs_default_test(self): """Test the get_installation_specs function with defaults.""" data = self._get_data() self.assertEqual(get_installation_specs(data), (["@core"], []))
def test_get_installation_specs_default(self): """Test the get_installation_specs function with defaults.""" data = PackagesSelectionData() assert get_installation_specs(data) == (["@core"], [])
def test_get_installation_specs_nocore(self): """Test the get_installation_specs function without core.""" data = PackagesSelectionData() data.core_group_enabled = False assert get_installation_specs(data) == ([], ["@core"])
def get_installation_specs_nocore_test(self): """Test the get_installation_specs function without core.""" data = PackagesSelectionData() data.core_group_enabled = False self.assertEqual(get_installation_specs(data), ([], ["@core"]))