diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-01-01 19:16:32 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-01-01 19:44:53 +0900 |
commit | 54265b7a9e6f493796bcb9c65682a73013e2a600 (patch) | |
tree | d178b17ac2e62497b5217da63d65558da894d2cc /tests/frontend/buildtrack.py | |
parent | c1b3a483d17337b45c9118ba2580437a89db2271 (diff) | |
download | buildstream-54265b7a9e6f493796bcb9c65682a73013e2a600.tar.gz |
tests/frontend: Updating tests to use new error checks
This also fixes #177 - the problem here was solved simply
by passing the project directory to `cli.run(project=project...)`
Diffstat (limited to 'tests/frontend/buildtrack.py')
-rw-r--r-- | tests/frontend/buildtrack.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/frontend/buildtrack.py b/tests/frontend/buildtrack.py index 45dd30d82..c351080b9 100644 --- a/tests/frontend/buildtrack.py +++ b/tests/frontend/buildtrack.py @@ -7,7 +7,7 @@ import pytest from tests.testutils import cli, create_repo from buildstream import _yaml -from buildstream._exceptions import LoadError +from buildstream._exceptions import ErrorDomain # Project directory @@ -254,10 +254,8 @@ def test_build_track_inconsistent(cli, datafiles, tmpdir, args += itertools.chain.from_iterable(zip(itertools.repeat('--track-except'), exceptions)) args += ['0.bst'] - result = cli.run(args=args, silent=True) - - assert result.exit_code != 0 - assert isinstance(result.exception, LoadError) + result = cli.run(project=project, args=args, silent=True) + result.assert_main_error(ErrorDomain.PIPELINE, "inconsistent-pipeline") # Assert that if a build element has a dependency in the tracking @@ -290,14 +288,14 @@ def test_build_track_track_first(cli, datafiles, tmpdir, strict): # Build 1.bst and 2.bst first so we have an artifact for them args = [strict, 'build', '2.bst'] result = cli.run(args=args, project=project, silent=True) - assert result.exit_code == 0 + result.assert_success() # Test building 0.bst while tracking 1.bst cli.remove_artifact_from_cache(project, '0.bst') args = [strict, 'build', '--track', '1.bst', '2.bst'] result = cli.run(args=args, project=project, silent=True) - assert result.exit_code == 0 + result.assert_success() # Assert that 1.bst successfully tracks before 0.bst builds track_messages = re.finditer(r'\[track:1.bst\s*]', result.stderr) |