def _test_kickstart(self, ks_in, ks_out): """Simulate the kickstart test. FIXME: This is a temporary workaround. """ spec = AnacondaKickstartSpecification # Parse a kickstart string. ks_in = dedent(ks_in).strip() handler = KickstartSpecificationHandler(spec) parser = KickstartSpecificationParser(handler, spec) parser.readKickstartFromString(ks_in) self.repositories = list( map(convert_ks_repo_to_repo_data, handler.repo.dataList())) # Verify the DBus data. RepoConfigurationData.to_structure_list(self.repositories) # Generate a kickstart string. ks_out = dedent(ks_out).strip() handler = KickstartSpecificationHandler(spec) for repo_data in self.repositories: ks_repo = convert_repo_data_to_ks_repo(repo_data) handler.repo.dataList().append(ks_repo) ks_generated = str(handler).strip() assert ks_generated == ks_out
def GetRepoConfigurations(self) -> List[Structure]: """Get RepoConfigurationData structures for all attached sources. FIXME: This is a temporary solution. Will be removed after DNF payload logic is moved. """ return RepoConfigurationData.to_structure_list( self.implementation.get_repo_configurations())
def _assert_repo_list_equal(self, l1, l2): assert RepoConfigurationData.to_structure_list(l1) == \ RepoConfigurationData.to_structure_list(l2)