summaryrefslogtreecommitdiff
path: root/tests/sandboxes
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2019-03-20 11:06:42 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-21 14:57:31 +0000
commitf2b15d86debd32241228f7b728016ed0057cd0d2 (patch)
treee98e085e4f0a9020725aa3a25df7809a96d807ba /tests/sandboxes
parentbc1b971e169f2fc721c61276c071640caee6a3f8 (diff)
downloadbuildstream-f2b15d86debd32241228f7b728016ed0057cd0d2.tar.gz
tests: str(datafiles) instead of a longer thing
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/sandboxes')
-rw-r--r--tests/sandboxes/missing-command.py2
-rw-r--r--tests/sandboxes/missing_dependencies.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/sandboxes/missing-command.py b/tests/sandboxes/missing-command.py
index a2b56d4a7..ee6d11280 100644
--- a/tests/sandboxes/missing-command.py
+++ b/tests/sandboxes/missing-command.py
@@ -14,6 +14,6 @@ DATA_DIR = os.path.join(
@pytest.mark.datafiles(DATA_DIR)
def test_missing_command(cli, datafiles):
- project = os.path.join(datafiles.dirname, datafiles.basename)
+ project = str(datafiles)
result = cli.run(project=project, args=['build', 'no-runtime.bst'])
result.assert_task_error(ErrorDomain.SANDBOX, 'missing-command')
diff --git a/tests/sandboxes/missing_dependencies.py b/tests/sandboxes/missing_dependencies.py
index 19515a187..850fddaa3 100644
--- a/tests/sandboxes/missing_dependencies.py
+++ b/tests/sandboxes/missing_dependencies.py
@@ -17,7 +17,7 @@ DATA_DIR = os.path.join(
@pytest.mark.skipif(not IS_LINUX, reason='Only available on Linux')
@pytest.mark.datafiles(DATA_DIR)
def test_missing_brwap_has_nice_error_message(cli, datafiles):
- project = os.path.join(datafiles.dirname, datafiles.basename)
+ project = str(datafiles)
element_path = os.path.join(project, 'elements', 'element.bst')
# Write out our test target
@@ -57,7 +57,7 @@ def test_old_brwap_has_nice_error_message(cli, datafiles, tmp_path):
bwrap.chmod(0o755)
- project = os.path.join(datafiles.dirname, datafiles.basename)
+ project = str(datafiles)
element_path = os.path.join(project, 'elements', 'element3.bst')
# Write out our test target