Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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("")
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]
def test_find_grp_pkgs(syncdb):
assert pyalpm.find_grp_pkgs([syncdb], 'test') == []
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)