diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-03 13:40:09 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-04 04:04:11 -0400 |
commit | af433395a27c9e29d2a5954a29acb6c77e5490fc (patch) | |
tree | b86d71fc54b4511e2cef9122fc482a61c3016aaa /tests/cachekey | |
parent | 15db6d56ec6617b96f0ec8966345fccd2a557617 (diff) | |
download | buildstream-af433395a27c9e29d2a5954a29acb6c77e5490fc.tar.gz |
tests/cachekey/cachekey.py: Use the cli runner fixture here.
Diffstat (limited to 'tests/cachekey')
-rw-r--r-- | tests/cachekey/cachekey.py | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py index d6f840dbc..8f350bf43 100644 --- a/tests/cachekey/cachekey.py +++ b/tests/cachekey/cachekey.py @@ -35,15 +35,12 @@ # run over to the corresponding .expected source files and commit # the result. # +from tests.testutils.runcli import cli import os from collections import OrderedDict -from click.testing import CliRunner import pytest -# Import the main cli entrypoint -from buildstream._frontend.main import cli - ############################################## # Some Helpers # @@ -148,17 +145,10 @@ DATA_DIR = os.path.join( ) -@pytest.fixture(scope="module") -def runner(): - return CliRunner() - - @pytest.mark.datafiles(DATA_DIR) -def test_cache_key(datafiles, runner): - project_dir = os.path.join(datafiles.dirname, datafiles.basename) - result = runner.invoke(cli, [ - '--no-verbose', - '--directory', project_dir, +def test_cache_key(datafiles, cli): + project = os.path.join(datafiles.dirname, datafiles.basename) + result = cli.run(project=project, silent=True, args=[ 'show', '--format', '%{name}::%{full-key}', 'target.bst' @@ -168,4 +158,4 @@ def test_cache_key(datafiles, runner): raise AssertionError("BuildStream exited with code {} and output:\n{}" .format(result.exit_code, result.output)) - assert_cache_keys(project_dir, result.output) + assert_cache_keys(project, result.output) |