summaryrefslogtreecommitdiff
path: root/tests/format/variables.py
diff options
context:
space:
mode:
authorTristan van Berkom <tristan.vanberkom@codethink.co.uk>2020-07-20 16:57:49 +0900
committerTristan van Berkom <tristan.vanberkom@codethink.co.uk>2020-07-22 18:37:33 +0900
commit59e6e2a3c1973c5efe09035c925c884b226192b3 (patch)
tree1be77bb7bce8ed846fc1cce3d96332ec86f357e7 /tests/format/variables.py
parent8f8eef574f501b4f9e91580f9c8d866c597bcddd (diff)
downloadbuildstream-tristan/partial-variables.tar.gz
tests/format/variables.py: Adding new test for lazy variable resolutiontristan/partial-variables
Check that lazy variable resolution allows using variables in junction definitions which would not successfully resolve if we needed to resolve synchronously.
Diffstat (limited to 'tests/format/variables.py')
-rw-r--r--tests/format/variables.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/format/variables.py b/tests/format/variables.py
index d4b8b787b..2f436fc75 100644
--- a/tests/format/variables.py
+++ b/tests/format/variables.py
@@ -233,3 +233,13 @@ def test_variables_resolving_errors_in_public_section(cli, datafiles):
result = cli.run(project=project, args=["show", "--format", "%{public}", "public_unresolved.bst"])
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.UNRESOLVED_VARIABLE)
+
+
+@pytest.mark.datafiles(os.path.join(DATA_DIR, "partial_context"))
+def test_partial_context_junctions(cli, datafiles):
+ project = str(datafiles)
+
+ result = cli.run(project=project, args=["show", "--format", "%{vars}", "test.bst"])
+ result.assert_success()
+ result_vars = _yaml.load_data(result.output)
+ assert result_vars.get_str("eltvar") == "/bar/foo/baz"