summaryrefslogtreecommitdiff
path: root/tests/format/variables.py
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2018-05-04 13:10:23 +0200
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-05-06 06:47:17 +0000
commit745d0647729dd31f07acc5829fd3364615673bc5 (patch)
tree58dfe713f03be16bbfcd68ff737338fcd5196f50 /tests/format/variables.py
parent451b05fc5209e36a7c044c7220da41dfe9e80e86 (diff)
downloadbuildstream-745d0647729dd31f07acc5829fd3364615673bc5.tar.gz
tests/format/variables.py: Add a test for undefined variable error message
Diffstat (limited to 'tests/format/variables.py')
-rw-r--r--tests/format/variables.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/format/variables.py b/tests/format/variables.py
index 1d34911ea..66c56b451 100644
--- a/tests/format/variables.py
+++ b/tests/format/variables.py
@@ -62,3 +62,17 @@ def test_overrides(cli, datafiles, tmpdir, target, varname, expected):
result.assert_success()
result_vars = _yaml.load_data(result.output)
assert result_vars[varname] == expected
+
+
+@pytest.mark.datafiles(os.path.join(DATA_DIR, 'missing_variables'))
+def test_missing_variable(cli, datafiles, tmpdir):
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+ result = cli.run(project=project, silent=True, args=[
+ 'show', '--deps', 'none', '--format', '%{config}', 'manual.bst'
+ ])
+ result.assert_main_error(ErrorDomain.LOAD,
+ LoadErrorReason.UNRESOLVED_VARIABLE)
+ expected = ("Error loading pipeline: "
+ "manual.bst [line 5 column 6]: "
+ "Unresolved variable 'foo'")
+ assert expected in result.stderr.splitlines()