コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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))
コード例 #4
0
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())
コード例 #5
0
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))
コード例 #6
0
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())