summaryrefslogtreecommitdiff
path: root/tests/examples/integration-commands.py
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2019-03-20 11:06:42 +0000
committerAngelos Evripiotis <jevripiotis@bloomberg.net>2019-03-20 12:20:53 +0000
commitab18ab8d9492bb8d9ad9a6d0123f42ab131d106d (patch)
tree5f8dbe327a4dd8978b70f9bc5cbeb94dbbae8474 /tests/examples/integration-commands.py
parente1b1e6c9d552cd960e1531023ead44c9f3408b45 (diff)
downloadbuildstream-aevri/dirname_basename.tar.gz
tests: str(datafiles) instead of a longer thingaevri/dirname_basename
Replace some popular copypasta. This important-looking invocation: os.path.join(datafiles.dirname, datafiles.basename) is equivalent to this shorter invocation: project = str(datafiles) It seems like it's very popular copypasta, replace it with the shorter one thus: # Use 'gsed' or 'sed' etc. as appropriate for your system. git config --global alias.sub '!f() { git grep --name-only --null "$1" | gxargs --null gsed --in-place --expression "s/$1/$2/g" ; }; f' git sub 'os.path.join(datafiles.dirname, datafiles.basename)' 'str(datafiles)'
Diffstat (limited to 'tests/examples/integration-commands.py')
-rw-r--r--tests/examples/integration-commands.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/examples/integration-commands.py b/tests/examples/integration-commands.py
index 542fc8bed..053447956 100644
--- a/tests/examples/integration-commands.py
+++ b/tests/examples/integration-commands.py
@@ -19,7 +19,7 @@ DATA_DIR = os.path.join(
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_integration_commands_build(cli, datafiles):
- project = os.path.join(datafiles.dirname, datafiles.basename)
+ project = str(datafiles)
result = cli.run(project=project, args=['build', 'hello.bst'])
assert result.exit_code == 0
@@ -31,7 +31,7 @@ def test_integration_commands_build(cli, datafiles):
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_integration_commands_run(cli, datafiles):
- project = os.path.join(datafiles.dirname, datafiles.basename)
+ project = str(datafiles)
result = cli.run(project=project, args=['build', 'hello.bst'])
assert result.exit_code == 0