[tracker-miners/sam/functional-tests-shared: 11/15] functional-tests: Merge common/utils package into the tests themselves
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/sam/functional-tests-shared: 11/15] functional-tests: Merge common/utils package into the tests themselves
- Date: Fri, 23 Aug 2019 09:43:34 +0000 (UTC)
commit e6afaaddbe1cd0fca3f41173a1ea694424bc0bda
Author: Sam Thursfield <sam afuera me uk>
Date: Wed Aug 21 22:49:22 2019 +0100
functional-tests: Merge common/utils package into the tests themselves
This package now contains just a few files, as most of the code has
moved to the utils/trackertestutils package in tracker.git. Let's take
tests/functional-tests/300-miner-basic-ops.py | 2 +-
tests/functional-tests/301-miner-resource-removal.py | 4 ++--
tests/functional-tests/310-fts-basic.py | 4 ++--
tests/functional-tests/311-fts-file-operations.py | 4 ++--
tests/functional-tests/312-fts-stopwords.py | 4 ++--
tests/functional-tests/400-extractor-metadata.py | 4 ++--
tests/functional-tests/401-extractor-flac-cuesheet.py | 4 ++--
tests/functional-tests/410-extractor-decorator.py | 4 ++--
tests/functional-tests/500-writeback-images.py | 4 ++--
tests/functional-tests/501-writeback-image-details.py | 4 ++--
tests/functional-tests/502-writeback-audio.py | 4 ++--
tests/functional-tests/600-applications-camera.py | 2 +-
tests/functional-tests/601-applications-sync.py | 2 +-
tests/functional-tests/{common/utils => }/applicationstest.py | 4 ++--
tests/functional-tests/common/utils/__init__.py | 1 -
tests/functional-tests/{common/utils => }/configuration.py | 0
tests/functional-tests/{common/utils => }/extractor.py | 2 +-
tests/functional-tests/{common/utils => }/minertest.py | 6 +++---
tests/functional-tests/{common/utils => }/system.py | 2 +-
tests/functional-tests/{common/utils => }/writebacktest.py | 6 +++---
20 files changed, 33 insertions(+), 34 deletions(-)
---
diff --git a/tests/functional-tests/300-miner-basic-ops.py b/tests/functional-tests/300-miner-basic-ops.py
index f783d9fbb..b4814e21b 100755
--- a/tests/functional-tests/300-miner-basic-ops.py
+++ b/tests/functional-tests/300-miner-basic-ops.py
@@ -31,7 +31,7 @@ import shutil
import time
import unittest as ut
-from common.utils.minertest import CommonTrackerMinerTest
+from minertest import CommonTrackerMinerTest
log = logging.getLogger(__name__)
diff --git a/tests/functional-tests/301-miner-resource-removal.py
b/tests/functional-tests/301-miner-resource-removal.py
index fd365430d..5aff1bb74 100755
--- a/tests/functional-tests/301-miner-resource-removal.py
+++ b/tests/functional-tests/301-miner-resource-removal.py
@@ -22,8 +22,8 @@ Test that resource removal does not leave debris or clobber too much,
especially in the case where nie:InformationElement != nie:DataObject
"""
-from common.utils import configuration as cfg
-from common.utils.minertest import CommonTrackerMinerTest
+import configuration as cfg
+from minertest import CommonTrackerMinerTest
from gi.repository import GLib
diff --git a/tests/functional-tests/310-fts-basic.py b/tests/functional-tests/310-fts-basic.py
index 4fc59fb06..219b73f7e 100755
--- a/tests/functional-tests/310-fts-basic.py
+++ b/tests/functional-tests/310-fts-basic.py
@@ -32,8 +32,8 @@ import locale
import time
import unittest as ut
-from common.utils.minertest import CommonTrackerMinerFTSTest, DEFAULT_TEXT
-from common.utils import configuration as cfg
+from minertest import CommonTrackerMinerFTSTest, DEFAULT_TEXT
+import configuration as cfg
class MinerFTSBasicTest (CommonTrackerMinerFTSTest):
diff --git a/tests/functional-tests/311-fts-file-operations.py
b/tests/functional-tests/311-fts-file-operations.py
index 32373f1bf..400734545 100755
--- a/tests/functional-tests/311-fts-file-operations.py
+++ b/tests/functional-tests/311-fts-file-operations.py
@@ -32,8 +32,8 @@ import locale
import time
import unittest as ut
-from common.utils.minertest import CommonTrackerMinerFTSTest, DEFAULT_TEXT
-from common.utils import configuration as cfg
+from minertest import CommonTrackerMinerFTSTest, DEFAULT_TEXT
+import configuration as cfg
NFO_DOCUMENT = 'http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document'
diff --git a/tests/functional-tests/312-fts-stopwords.py b/tests/functional-tests/312-fts-stopwords.py
index 6ba8ac591..b50e8377a 100755
--- a/tests/functional-tests/312-fts-stopwords.py
+++ b/tests/functional-tests/312-fts-stopwords.py
@@ -32,8 +32,8 @@ import locale
import time
import unittest as ut
-from common.utils.minertest import CommonTrackerMinerFTSTest, DEFAULT_TEXT
-from common.utils import configuration as cfg
+from minertest import CommonTrackerMinerFTSTest, DEFAULT_TEXT
+import configuration as cfg
class MinerFTSStopwordsTest (CommonTrackerMinerFTSTest):
diff --git a/tests/functional-tests/400-extractor-metadata.py
b/tests/functional-tests/400-extractor-metadata.py
index 628b063de..772175475 100755
--- a/tests/functional-tests/400-extractor-metadata.py
+++ b/tests/functional-tests/400-extractor-metadata.py
@@ -24,8 +24,8 @@ metadata is extracted. Load dynamically the test information from a data
directory (containing xxx.expected files)
"""
-from common.utils import configuration as cfg
-from common.utils.extractor import get_tracker_extract_jsonld_output, TrackerExtractTestCase
+import configuration as cfg
+from extractor import get_tracker_extract_jsonld_output, TrackerExtractTestCase
import unittest as ut
import json
import os
diff --git a/tests/functional-tests/401-extractor-flac-cuesheet.py
b/tests/functional-tests/401-extractor-flac-cuesheet.py
index 301a6868d..276156676 100755
--- a/tests/functional-tests/401-extractor-flac-cuesheet.py
+++ b/tests/functional-tests/401-extractor-flac-cuesheet.py
@@ -27,8 +27,8 @@ import shutil
import tempfile
import unittest as ut
-import common.utils.configuration as cfg
-from common.utils.extractor import get_tracker_extract_jsonld_output, create_test_flac,
TrackerExtractTestCase
+import configuration as cfg
+from extractor import get_tracker_extract_jsonld_output, create_test_flac, TrackerExtractTestCase
class FlacCuesheetTest(TrackerExtractTestCase):
diff --git a/tests/functional-tests/410-extractor-decorator.py
b/tests/functional-tests/410-extractor-decorator.py
index 338e64fdb..c6a43d019 100755
--- a/tests/functional-tests/410-extractor-decorator.py
+++ b/tests/functional-tests/410-extractor-decorator.py
@@ -30,8 +30,8 @@ import shutil
import tempfile
import time
-import common.utils.configuration as cfg
-from common.utils.system import TrackerSystemAbstraction
+import configuration as cfg
+from system import TrackerSystemAbstraction
CORRUPT_FILE = os.path.join(
diff --git a/tests/functional-tests/500-writeback-images.py b/tests/functional-tests/500-writeback-images.py
index b9a5b080d..dba88d495 100755
--- a/tests/functional-tests/500-writeback-images.py
+++ b/tests/functional-tests/500-writeback-images.py
@@ -26,8 +26,8 @@ import os
import sys
import time
-from common.utils.extractor import get_tracker_extract_jsonld_output
-from common.utils.writebacktest import CommonTrackerWritebackTest
+from extractor import get_tracker_extract_jsonld_output
+from writebacktest import CommonTrackerWritebackTest
import unittest as ut
log = logging.getLogger(__name__)
diff --git a/tests/functional-tests/501-writeback-image-details.py
b/tests/functional-tests/501-writeback-image-details.py
index cfe416b72..d555335d0 100755
--- a/tests/functional-tests/501-writeback-image-details.py
+++ b/tests/functional-tests/501-writeback-image-details.py
@@ -24,8 +24,8 @@ import sys
import time
import unittest as ut
-from common.utils.writebacktest import CommonTrackerWritebackTest as CommonTrackerWritebackTest
-from common.utils.extractor import get_tracker_extract_jsonld_output
+from writebacktest import CommonTrackerWritebackTest as CommonTrackerWritebackTest
+from extractor import get_tracker_extract_jsonld_output
log = logging.getLogger(__name__)
diff --git a/tests/functional-tests/502-writeback-audio.py b/tests/functional-tests/502-writeback-audio.py
index 92b31bed3..cb5350f70 100755
--- a/tests/functional-tests/502-writeback-audio.py
+++ b/tests/functional-tests/502-writeback-audio.py
@@ -20,8 +20,8 @@
import unittest
-from common.utils.extractor import get_tracker_extract_jsonld_output
-from common.utils.writebacktest import CommonTrackerWritebackTest
+from extractor import get_tracker_extract_jsonld_output
+from writebacktest import CommonTrackerWritebackTest
class WritebackAudioTest(CommonTrackerWritebackTest):
diff --git a/tests/functional-tests/600-applications-camera.py
b/tests/functional-tests/600-applications-camera.py
index c5322d06c..5c9f514c5 100755
--- a/tests/functional-tests/600-applications-camera.py
+++ b/tests/functional-tests/600-applications-camera.py
@@ -27,7 +27,7 @@ import os
import random
import unittest as ut
-from common.utils.applicationstest import CommonTrackerApplicationTest as CommonTrackerApplicationTest
+from applicationstest import CommonTrackerApplicationTest as CommonTrackerApplicationTest
log = logging.getLogger(__name__)
diff --git a/tests/functional-tests/601-applications-sync.py b/tests/functional-tests/601-applications-sync.py
index c0000deca..32f33a1a4 100755
--- a/tests/functional-tests/601-applications-sync.py
+++ b/tests/functional-tests/601-applications-sync.py
@@ -28,7 +28,7 @@ import random
import shutil
import unittest as ut
-from common.utils.applicationstest import CommonTrackerApplicationTest as CommonTrackerApplicationTest
+from applicationstest import CommonTrackerApplicationTest as CommonTrackerApplicationTest
log = logging.getLogger(__name__)
diff --git a/tests/functional-tests/common/utils/applicationstest.py
b/tests/functional-tests/applicationstest.py
similarity index 97%
rename from tests/functional-tests/common/utils/applicationstest.py
rename to tests/functional-tests/applicationstest.py
index acdb6f015..18fb7c85b 100644
--- a/tests/functional-tests/common/utils/applicationstest.py
+++ b/tests/functional-tests/applicationstest.py
@@ -17,8 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
-from common.utils import configuration as cfg
-from common.utils.system import TrackerSystemAbstraction
+import configuration as cfg
+from system import TrackerSystemAbstraction
import unittest as ut
from gi.repository import GLib
diff --git a/tests/functional-tests/common/utils/configuration.py b/tests/functional-tests/configuration.py
similarity index 100%
rename from tests/functional-tests/common/utils/configuration.py
rename to tests/functional-tests/configuration.py
diff --git a/tests/functional-tests/common/utils/extractor.py b/tests/functional-tests/extractor.py
similarity index 99%
rename from tests/functional-tests/common/utils/extractor.py
rename to tests/functional-tests/extractor.py
index cf85c3f4b..1b921616f 100644
--- a/tests/functional-tests/common/utils/extractor.py
+++ b/tests/functional-tests/extractor.py
@@ -19,7 +19,7 @@
# 02110-1301, USA.
#
-from common.utils import configuration as cfg
+import configuration as cfg
import errno
import json
import logging
diff --git a/tests/functional-tests/common/utils/minertest.py b/tests/functional-tests/minertest.py
similarity index 97%
rename from tests/functional-tests/common/utils/minertest.py
rename to tests/functional-tests/minertest.py
index 650c03eb1..9dcb3c528 100644
--- a/tests/functional-tests/common/utils/minertest.py
+++ b/tests/functional-tests/minertest.py
@@ -18,8 +18,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
-from common.utils import configuration as cfg
-from common.utils.system import TrackerSystemAbstraction
+import configuration as cfg
+from system import TrackerSystemAbstraction
import unittest as ut
from gi.repository import GLib
@@ -186,7 +186,7 @@ class CommonTrackerMinerFTSTest (CommonTrackerMinerTest):
and assert the testfile is only result.
Be careful with the default contents of the text files
- ( see common/utils/minertest.py DEFAULT_TEXT )
+ ( see minertest.py DEFAULT_TEXT )
"""
self.set_text(text)
results = self.search_word(word)
diff --git a/tests/functional-tests/common/utils/system.py b/tests/functional-tests/system.py
similarity index 99%
rename from tests/functional-tests/common/utils/system.py
rename to tests/functional-tests/system.py
index 8c980fb48..824790ff1 100644
--- a/tests/functional-tests/common/utils/system.py
+++ b/tests/functional-tests/system.py
@@ -9,7 +9,7 @@ from gi.repository import GLib
import trackertestutils.dconf
import trackertestutils.helpers
-from . import configuration as cfg
+import configuration as cfg
TEST_ENV_VARS = {"LC_COLLATE": "en_GB.utf8"}
diff --git a/tests/functional-tests/common/utils/writebacktest.py b/tests/functional-tests/writebacktest.py
similarity index 95%
rename from tests/functional-tests/common/utils/writebacktest.py
rename to tests/functional-tests/writebacktest.py
index 0a31b44ff..c511b02f5 100644
--- a/tests/functional-tests/common/utils/writebacktest.py
+++ b/tests/functional-tests/writebacktest.py
@@ -27,8 +27,8 @@ import shutil
import time
import unittest as ut
-from common.utils.system import TrackerSystemAbstraction
-from common.utils import configuration as cfg
+from system import TrackerSystemAbstraction
+import configuration as cfg
TEST_FILE_JPEG = "writeback-test-1.jpeg"
TEST_FILE_TIFF = "writeback-test-2.tif"
@@ -75,7 +75,7 @@ class CommonTrackerWritebackTest (ut.TestCase):
def datadir_path(self, filename):
"""Returns the full path to a writeback test file."""
- datadir = os.path.join(os.path.dirname(__file__), '..', '..', 'test-writeback-data')
+ datadir = os.path.join(os.path.dirname(__file__), 'test-writeback-data')
return pathlib.Path(os.path.join(datadir, filename))
def prepare_test_file(self, path, expect_mime_type, expect_property):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]