def test_undumpsubrepos(f): """<subrepo> element should be mapped to different classes""" root = repotreemodel.readXml(f, 'reporegistry') allgroup = root.child(0) assert type(allgroup.child(0)) is repotreeitem.StandaloneSubrepoItem subroot = allgroup.child(1) assert type(subroot) is repotreeitem.RepoItem assert type(subroot.child(0)) is repotreeitem.AlienSubrepoItem assert type(subroot.child(1)) is repotreeitem.SubrepoItem
def test_getrepoitemlist_standalone(f): root = repotreemodel.readXml(f, 'reporegistry') items = repotreemodel.getRepoItemList(root, standalone=True) assert_equals(full_data_standalone_repos, map(lambda e: e.rootpath(), items))
def test_readwritexml(f): root = repotreemodel.readXml(f, 'reporegistry') f.buffer().clear() f.reset() repotreemodel.writeXml(f, root, 'reporegistry') assert_equals(full_data.splitlines(), str(f.data()).splitlines())