diff options
author | Valentin David <valentin.david@codethink.co.uk> | 2018-05-04 13:10:23 +0200 |
---|---|---|
committer | Valentin David <valentin.david@codethink.co.uk> | 2018-05-04 13:44:20 +0200 |
commit | 0ea453b5944ddab247ebbf3026b934b2c6f85b04 (patch) | |
tree | 67a12572e140a066b1547a2b188c2c0146c15486 /tests/format/variables.py | |
parent | 20464d5f1d9f883740d7098045d647fb845c9ead (diff) | |
download | buildstream-valentindavid/253_better_missing_variable_errors.tar.gz |
tests/format/variables.py: Add a test for undefined variable error messagevalentindavid/253_better_missing_variable_errors
Diffstat (limited to 'tests/format/variables.py')
-rw-r--r-- | tests/format/variables.py | 14 |
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() |