How to use the pyalpm.find_grp_pkgs function in pyalpm

To help you get started, we’ve selected a few pyalpm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github archlinux / pyalpm / test / test_alpm.py View on Github external
def test_find_grp_pkgs_error():
    with pytest.raises(TypeError) as excinfo:
        pyalpm.find_grp_pkgs()
    assert 'expected arguments' in str(excinfo.value)

    with pytest.raises(TypeError) as excinfo:
        pyalpm.find_grp_pkgs([None], 'test')
    assert 'list must contain only Database objects' in str(excinfo.value)
github archlinux / pyalpm / test / tests.py View on Github external
for i in os.listdir("/var/cache/pacman/pkg"):
    filename = os.path.join("/var/cache/pacman/pkg", i)
    pkg = h.load_pkg(filename)
    print("Loaded", filename)
    break
for attr in dir(pkg):
    if attr.startswith('_'):
        continue
    if attr == "files":
        print("  ", len(pkg.files), "files")
    else:
        print("  ", attr, ":", getattr(pkg, attr))
print("")

print("Information about group gnome")
l = pyalpm.find_grp_pkgs([core, extra, community], "gnome")
for pkg in l:
    print("  ", pkg.name, "from", pkg.db.name)
print("")
github archlinux / pyalpm / test / test_refcounting.py View on Github external
def get_find_grp_pkgs():
    handle = Handle('/', '/tmp/')
    repo = handle.register_syncdb(REPO_1, 0)
    repo.servers = [TEST_MIRROR.format(REPO_1, ARCH)]
    db = handle.get_syncdbs()[0]
    db.update(False)
    return find_grp_pkgs([db], "base")[0]
github archlinux / pyalpm / test / test_alpm.py View on Github external
def test_find_grp_pkgs(syncdb):
    assert pyalpm.find_grp_pkgs([syncdb], 'test') == []
github archlinux / pyalpm / test / test_alpm.py View on Github external
def test_find_grp_pkgs_error():
    with pytest.raises(TypeError) as excinfo:
        pyalpm.find_grp_pkgs()
    assert 'expected arguments' in str(excinfo.value)

    with pytest.raises(TypeError) as excinfo:
        pyalpm.find_grp_pkgs([None], 'test')
    assert 'list must contain only Database objects' in str(excinfo.value)