summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-26 14:46:12 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-26 14:47:17 +0900
commitedfcd0f6252fe01a4b3805a023296ca6f53e50b1 (patch)
treea7b848e3b8063d3d6cfe958c072d8a5abe441385
parent14aa2590ea20fda8dff8dc9ffd1501654dbdeb19 (diff)
downloadbuildstream-edfcd0f6252fe01a4b3805a023296ca6f53e50b1.tar.gz
_loader.py: Removing special case error for junctions depending on elements
Leave this error to be handled by preflight. Updated test case to expect the new ElementError instead of a LoadError
-rw-r--r--buildstream/_loader/loader.py4
-rw-r--r--tests/loader/junctions.py6
2 files changed, 3 insertions, 7 deletions
diff --git a/buildstream/_loader/loader.py b/buildstream/_loader/loader.py
index 8e6c76425..fd0f9445f 100644
--- a/buildstream/_loader/loader.py
+++ b/buildstream/_loader/loader.py
@@ -404,10 +404,6 @@ class Loader():
# Descend
for dep in element.deps:
- if element_kind == 'junction':
- raise LoadError(LoadErrorReason.INVALID_DATA,
- "{}: Junctions do not support dependencies".format(dep.provenance))
-
loader = self._get_loader_for_dep(dep)
meta_dep = loader._collect_element(dep.name)
if dep.dep_type != 'runtime':
diff --git a/tests/loader/junctions.py b/tests/loader/junctions.py
index df77e0064..635a987bd 100644
--- a/tests/loader/junctions.py
+++ b/tests/loader/junctions.py
@@ -2,7 +2,7 @@ import os
import pytest
import shutil
-from buildstream import _yaml
+from buildstream import _yaml, ElementError
from buildstream._exceptions import LoadError, LoadErrorReason
from tests.testutils import cli, create_repo
from tests.testutils.site import HAVE_GIT
@@ -130,8 +130,8 @@ def test_invalid_with_deps(cli, datafiles):
result = cli.run(project=project, args=['build', 'junction-with-deps.bst'])
assert result.exit_code != 0
assert result.exception
- assert isinstance(result.exception, LoadError)
- assert result.exception.reason == LoadErrorReason.INVALID_DATA
+ assert isinstance(result.exception, ElementError)
+ assert result.exception.reason == 'element-forbidden-depends'
@pytest.mark.datafiles(DATA_DIR)