[tracker-miners/sam/tracker-3.0-functional-tests: 6/7] functional-tests: Run with build dir as current working directory
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/sam/tracker-3.0-functional-tests: 6/7] functional-tests: Run with build dir as current working directory
- Date: Mon, 17 Feb 2020 23:14:00 +0000 (UTC)
commit 06d04bec1b36108942a30baded963dc7703490ea
Author: Sam Thursfield <sam afuera me uk>
Date: Wed Feb 12 01:37:15 2020 +0100
functional-tests: Run with build dir as current working directory
tests/functional-tests/extractor-flac-cuesheet.py | 10 +++++-----
tests/functional-tests/meson.build | 3 +--
2 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/tests/functional-tests/extractor-flac-cuesheet.py
b/tests/functional-tests/extractor-flac-cuesheet.py
index 46a9fb356..2497ae0de 100755
--- a/tests/functional-tests/extractor-flac-cuesheet.py
+++ b/tests/functional-tests/extractor-flac-cuesheet.py
@@ -20,7 +20,7 @@ Tests the FLAC+cuesheet extraction feature.
"""
-import os
+import pathlib
import shutil
import tempfile
import unittest as ut
@@ -32,7 +32,7 @@ import fixtures
class FlacCuesheetTest(fixtures.TrackerExtractTestCase):
def spec(self, audio_path):
- audio_uri = 'file://' + audio_path
+ audio_uri = audio_path.as_uri()
return {
'@type': ['nfo:Audio'],
'nie:url': audio_uri,
@@ -83,10 +83,10 @@ class FlacCuesheetTest(fixtures.TrackerExtractTestCase):
def test_external_cue_sheet(self):
with tempfile.TemporaryDirectory() as tmpdir:
- datadir = os.path.join(os.getcwd() + "/test-extraction-data")
- shutil.copy(os.path.join(datadir, 'audio', 'cuesheet-test.cue'), tmpdir)
+ datadir = pathlib.Path(__file__).parent.joinpath('test-extraction-data')
+ shutil.copy(datadir.joinpath('audio', 'cuesheet-test.cue'), tmpdir)
- audio_path = os.path.join(tmpdir, 'cuesheet-test.flac')
+ audio_path = pathlib.Path(tmpdir).joinpath('cuesheet-test.flac')
datagenerator.create_test_flac(audio_path, duration=6*60)
result = fixtures.get_tracker_extract_jsonld_output(
diff --git a/tests/functional-tests/meson.build b/tests/functional-tests/meson.build
index 3548420e7..7e5037f39 100644
--- a/tests/functional-tests/meson.build
+++ b/tests/functional-tests/meson.build
@@ -167,11 +167,10 @@ foreach t: extractor_tests
endforeach
foreach t: functional_tests
- file = '@0@.py'.format(t)
+ file = meson.current_source_dir() / '@0@.py'.format(t)
test(t, python,
args: [file],
env: test_env,
- workdir: meson.current_source_dir(),
suite: ['functional'] + test_suite,
timeout: 120)
endforeach
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]