def test_transitive_installed_dependents(mock_packages, database): with color_when(False): out = dependents('--installed', '--transitive', 'fake') lines = [l for l in out.strip().split('\n') if not l.startswith('--')] hashes = set([re.split(r'\s+', l)[0] for l in lines]) expected = set([spack.store.db.query_one(s).dag_hash(7) for s in ['zmpi', 'callpath^zmpi', 'mpileaks^zmpi']]) assert expected == hashes
def test_immediate_installed_dependencies(builtin_mock, database): with color_when(False): out = dependencies('--installed', 'mpileaks^mpich') lines = [l for l in out.strip().split('\n') if not l.startswith('--')] hashes = set([re.split(r'\s+', l)[0] for l in lines]) expected = set([spack.store.db.query_one(s).dag_hash(7) for s in ['mpich', 'callpath^mpich']]) assert expected == hashes
def test_immediate_installed_dependents(mock_packages, database): with color_when(False): out = dependents('--installed', 'libelf') lines = [l for l in out.strip().split('\n') if not l.startswith('--')] hashes = set([re.split(r'\s+', l)[0] for l in lines]) expected = set([spack.store.db.query_one(s).dag_hash(7) for s in ['dyninst', 'libdwarf']]) libelf = spack.store.db.query_one('libelf') expected = set([d.dag_hash(7) for d in libelf.dependents()]) assert expected == hashes