parent
11e3e332bd
commit
f6781d65f0
2 changed files with 25 additions and 6 deletions
|
@ -416,11 +416,9 @@ def listspecs(args):
|
|||
"""list binary packages available from mirrors"""
|
||||
specs = bindist.get_specs(args.force)
|
||||
if args.packages:
|
||||
pkgs = set(args.packages)
|
||||
specs = [s for s in specs for p in pkgs if s.satisfies(p)]
|
||||
display_specs(specs, args, all_headers=True)
|
||||
else:
|
||||
display_specs(specs, args, all_headers=True)
|
||||
constraints = set(args.packages)
|
||||
specs = [s for s in specs if any(s.satisfies(c) for c in constraints)]
|
||||
display_specs(specs, args, all_headers=True)
|
||||
|
||||
|
||||
def getkeys(args):
|
||||
|
|
|
@ -8,11 +8,19 @@
|
|||
import pytest
|
||||
|
||||
import spack.main
|
||||
|
||||
import spack.binary_distribution
|
||||
|
||||
buildcache = spack.main.SpackCommand('buildcache')
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def mock_get_specs(database, monkeypatch):
|
||||
specs = database.query_local()
|
||||
monkeypatch.setattr(
|
||||
spack.binary_distribution, 'get_specs', lambda x: specs
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
platform.system().lower() != 'linux',
|
||||
reason='implementation for MacOS still missing'
|
||||
|
@ -20,3 +28,16 @@
|
|||
@pytest.mark.db
|
||||
def test_buildcache_preview_just_runs(database):
|
||||
buildcache('preview', 'mpileaks')
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
platform.system().lower() != 'linux',
|
||||
reason='implementation for MacOS still missing'
|
||||
)
|
||||
@pytest.mark.db
|
||||
@pytest.mark.regression('13757')
|
||||
def test_buildcache_list_duplicates(mock_get_specs, capsys):
|
||||
with capsys.disabled():
|
||||
output = buildcache('list', 'mpileaks', '@2.3')
|
||||
|
||||
assert output.count('mpileaks') == 3
|
||||
|
|
Loading…
Reference in a new issue