diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-08-16 13:57:06 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-08-16 14:01:48 +0100 |
commit | 20fd087164b91e0a92777101e0f9819648655382 (patch) | |
tree | 62e75dba33017a1d6843b23ac03b7ac196592159 /tests/format | |
parent | 0aca836471655e305ed075e374d04f0c657789ee (diff) | |
download | buildstream-20fd087164b91e0a92777101e0f9819648655382.tar.gz |
tests: Include testing provenance through options and includes
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Diffstat (limited to 'tests/format')
-rw-r--r-- | tests/format/invalid-keys/included-source.bst | 4 | ||||
-rw-r--r-- | tests/format/invalid-keys/optional-source.bst | 6 | ||||
-rw-r--r-- | tests/format/invalid-keys/project.conf | 6 | ||||
-rw-r--r-- | tests/format/invalid-keys/somesource.yaml | 1 | ||||
-rw-r--r-- | tests/format/invalid_keys.py | 11 |
5 files changed, 25 insertions, 3 deletions
diff --git a/tests/format/invalid-keys/included-source.bst b/tests/format/invalid-keys/included-source.bst new file mode 100644 index 000000000..559031bcd --- /dev/null +++ b/tests/format/invalid-keys/included-source.bst @@ -0,0 +1,4 @@ +kind: import + +sources: + - (@): somesource.yaml diff --git a/tests/format/invalid-keys/optional-source.bst b/tests/format/invalid-keys/optional-source.bst new file mode 100644 index 000000000..3234969a9 --- /dev/null +++ b/tests/format/invalid-keys/optional-source.bst @@ -0,0 +1,6 @@ +kind: import + +sources: + - (?): + - not thingy: + kind: local diff --git a/tests/format/invalid-keys/project.conf b/tests/format/invalid-keys/project.conf index b32753625..c24f5789e 100644 --- a/tests/format/invalid-keys/project.conf +++ b/tests/format/invalid-keys/project.conf @@ -1 +1,7 @@ name: test + +options: + thingy: + type: bool + description: A thingy + default: false diff --git a/tests/format/invalid-keys/somesource.yaml b/tests/format/invalid-keys/somesource.yaml new file mode 100644 index 000000000..753a3bc40 --- /dev/null +++ b/tests/format/invalid-keys/somesource.yaml @@ -0,0 +1 @@ +kind: local diff --git a/tests/format/invalid_keys.py b/tests/format/invalid_keys.py index 12e07b01b..861cfeabd 100644 --- a/tests/format/invalid_keys.py +++ b/tests/format/invalid_keys.py @@ -14,10 +14,15 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) -def test_compositied_node_fails_usefully(cli, datafiles): +@pytest.mark.parametrize(("element", "location"), [ + ("no-path-specified.bst", "line 4 column 4"), + ("optional-source.bst", "line 6 column 10"), + ("included-source.bst", "line 4 column 4"), +]) +def test_compositied_node_fails_usefully(cli, datafiles, element, location): project = str(datafiles) - result = cli.run(project=project, args=['show', 'no-path-specified.bst']) + result = cli.run(project=project, args=['show', element]) result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA) assert "synthetic node" not in result.stderr - assert "no-path-specified.bst [line 4 column 4]: Dictionary did not contain expected key 'path'" in result.stderr + assert "{} [{}]: Dictionary did not contain expected key 'path'".format(element, location) in result.stderr |