summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2014-12-28 22:23:04 +0000
committerSam Thursfield <sam@afuera.me.uk>2014-12-29 18:00:26 +0000
commitaf0ad7ba5814838a96014e439c52c43e6d943794 (patch)
tree7ed3713b2133d96c62509ce72469c4f91a851908
parent1b7ee32a55feeb4e444f23d7a30d08ab5738582a (diff)
downloadtracker-af0ad7ba5814838a96014e439c52c43e6d943794.tar.gz
WIP: functional-tests: Use Python 'unittest' test runner
The store tests seem to fail because the store hasn't fully loaded by the time the test starts. It might be worth not isolating the store tests, since they work fine anyway most of the time ... Some other weird error occurs too.
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/apps/test_camera.py0
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/apps/test_sync.py0
-rw-r--r--tests/functional-tests/common/__init__.py19
-rw-r--r--tests/functional-tests/common/utils/applicationstest.py55
-rw-r--r--tests/functional-tests/common/utils/expectedFailure.py3
-rw-r--r--tests/functional-tests/common/utils/helpers.py23
-rw-r--r--tests/functional-tests/common/utils/storetest.py36
-rw-r--r--tests/functional-tests/common/utils/system.py28
-rw-r--r--tests/functional-tests/common/utils/writebacktest.py5
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_backup_restore.py (renamed from tests/functional-tests/store/200-backup-restore.py)0
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_coalesce.py (renamed from tests/functional-tests/store/05-coalesce.py)4
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_collation.py (renamed from tests/functional-tests/store/16-collation.py)3
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_concurrent_query.py (renamed from tests/functional-tests/store/09-concurrent-query.py)4
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_distance.py (renamed from tests/functional-tests/store/06-distance.py)4
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_fts_functions.py (renamed from tests/functional-tests/store/03-fts-functions.py)0
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_graph.py (renamed from tests/functional-tests/store/07-graph.py)0
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_group_concat.py (renamed from tests/functional-tests/store/04-group-concat.py)0
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_insertion.py (renamed from tests/functional-tests/store/01-insertion.py)0
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_ontology_changes.py (renamed from tests/functional-tests/store/17-ontology-changes.py)8
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_signals.py (renamed from tests/functional-tests/store/14-signals.py)4
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_sparql_bugs.py (renamed from tests/functional-tests/store/02-sparql-bugs.py)0
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_sqlite_batch_misused.py (renamed from tests/functional-tests/store/11-sqlite-batch-misused.py)0
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_sqlite_misused.py (renamed from tests/functional-tests/store/10-sqlite-misused.py)2
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_statistics.py (renamed from tests/functional-tests/store/15-statistics.py)5
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_threaded_store.py (renamed from tests/functional-tests/store/13-threaded-store.py)2
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_transactions.py (renamed from tests/functional-tests/store/12-transactions.py)4
-rw-r--r--[-rwxr-xr-x]tests/functional-tests/store/test_unique_insertions.py (renamed from tests/functional-tests/store/08-unique-insertions.py)0
27 files changed, 115 insertions, 94 deletions
diff --git a/tests/functional-tests/apps/test_camera.py b/tests/functional-tests/apps/test_camera.py
index 333e982f5..333e982f5 100755..100644
--- a/tests/functional-tests/apps/test_camera.py
+++ b/tests/functional-tests/apps/test_camera.py
diff --git a/tests/functional-tests/apps/test_sync.py b/tests/functional-tests/apps/test_sync.py
index 92b2127ad..92b2127ad 100755..100644
--- a/tests/functional-tests/apps/test_sync.py
+++ b/tests/functional-tests/apps/test_sync.py
diff --git a/tests/functional-tests/common/__init__.py b/tests/functional-tests/common/__init__.py
index 013e4b7ec..2ad2baba5 100644
--- a/tests/functional-tests/common/__init__.py
+++ b/tests/functional-tests/common/__init__.py
@@ -1 +1,18 @@
-#!/usr/bin/python
+# Copyright (C) 2014, Sam Thursfield <sam@afuera.me.uk>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+import testcase
diff --git a/tests/functional-tests/common/utils/applicationstest.py b/tests/functional-tests/common/utils/applicationstest.py
index 708ee3629..84ebfeedc 100644
--- a/tests/functional-tests/common/utils/applicationstest.py
+++ b/tests/functional-tests/common/utils/applicationstest.py
@@ -17,6 +17,7 @@
# 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
from common.utils.helpers import log
@@ -28,6 +29,9 @@ import shutil
import os
import time
+import common
+
+
APPLICATIONS_TMP_DIR = os.path.join(
cfg.TEST_MONITORED_TMP_DIR, "test-applications-monitored")
@@ -48,49 +52,9 @@ SLOWCOPY_RATE = 1024
import subprocess
import tempfile
-class TrackerTestCase(ut.TestCase):
- '''Base class for all Tracker functional tests.
-
- This class handles isolating each test case from both other test cases and
- from the host system.
-
- '''
- def setUp(self):
- self._old_environ = os.environ
-
- self.fake_home()
- self.launch_session_bus()
-
- def fake_home(self):
- self.tempdir = tempfile.mkdtemp(prefix='tracker-test')
-
- # We need to use the actual home directory for some tests because
- # Tracker will explicitly ignore files in /tmp ...
- os.environ['REAL_HOME'] = os.path.expanduser('~')
- # ... but /tmp is preferred for test data, to avoid leaving debris
- # in the filesystem
- os.environ['HOME'] = self.tempdir
- log("HOME=%s" % self.tempdir)
+class CommonTrackerApplicationTest (common.TestCase):
- def launch_session_bus(self):
- self.dbus_process = subprocess.Popen(
- ["dbus-daemon", "--session", "--print-address=1", "--fork"],
- stdout=subprocess.PIPE)
- self.dbus_address = self.dbus_process.stdout.readline().rstrip()
-
- os.environ['DBUS_SESSION_BUS_ADDRESS'] = self.dbus_address
- log("DBUS_SESSION_BUS_ADDRESS=%s" % self.dbus_address)
-
- def tearDown(self):
- log('Stopping D-Bus daemon (PID %i) ...' % (self.dbus_process.pid))
- self.dbus_process.terminate()
- self.dbus_process.wait()
-
- os.environ = self._old_environ
-
-
-class CommonTrackerApplicationTest(TrackerTestCase):
def get_urn_count_by_url(self, url):
select = """
SELECT ?u WHERE { ?u nie:url \"%s\" }
@@ -155,7 +119,7 @@ class CommonTrackerApplicationTest(TrackerTestCase):
"test-apps-data")
self.system = TrackerSystemAbstraction()
- self.system.tracker_all_testing_start(CONF_OPTIONS)
+ self.system.tracker_all_testing_start(CONF_OPTIONS, self.dbus_address)
# Returns when ready
self.tracker = self.system.store
@@ -163,10 +127,11 @@ class CommonTrackerApplicationTest(TrackerTestCase):
log("Ready to go!")
def tearDown(self):
- self.system.tracker_all_testing_stop ()
+ # print "Stopping the daemon in test mode (Doing nothing now)"
+ self.system.tracker_all_testing_stop()
# Remove monitored directory
- if (os.path.exists (APPLICATIONS_TMP_DIR)):
- shutil.rmtree (APPLICATIONS_TMP_DIR)
+ if (os.path.exists(APPLICATIONS_TMP_DIR)):
+ shutil.rmtree(APPLICATIONS_TMP_DIR)
super(CommonTrackerApplicationTest, self).tearDown()
diff --git a/tests/functional-tests/common/utils/expectedFailure.py b/tests/functional-tests/common/utils/expectedFailure.py
index de1a8c8c9..a222cbab8 100644
--- a/tests/functional-tests/common/utils/expectedFailure.py
+++ b/tests/functional-tests/common/utils/expectedFailure.py
@@ -27,9 +27,10 @@ on the files. Note that these tests are highly platform dependant.
"""
import sys
import unittest as ut
-from unittest.compatibility import wraps
import configuration as cfg
+from functools import wraps
+
def expectedFailureBug(bugnumber):
"""
diff --git a/tests/functional-tests/common/utils/helpers.py b/tests/functional-tests/common/utils/helpers.py
index a4e1c1018..ce204c4d3 100644
--- a/tests/functional-tests/common/utils/helpers.py
+++ b/tests/functional-tests/common/utils/helpers.py
@@ -81,17 +81,13 @@ class Helper:
sys.exit()
sys.excepthook = new_hook
- def _get_bus(self):
- if self.bus is not None:
- log ("--- return existing bus %s" % self.bus)
- return
-
+ def _get_bus(self, dbus_address):
self.loop = GObject.MainLoop()
self.install_glib_excepthook(self.loop)
dbus_loop = DBusGMainLoop(set_as_default=True)
- self.bus = dbus.SessionBus(dbus_loop)
+ self.bus = dbus.bus.BusConnection(dbus_address, mainloop=dbus_loop)
obj = self.bus.get_object("org.freedesktop.DBus",
"/org/freedesktop/DBus")
@@ -151,12 +147,13 @@ class Helper:
self.timeout_id = None
return False
- def start(self):
+ def start(self, dbus_address):
"""
Start an instance of process and wait for it to appear on the bus.
"""
- self._get_bus()
+ if self.bus is None:
+ self._get_bus(dbus_address)
if (self.bus_admin.NameHasOwner(self.BUS_NAME)):
raise Exception(
@@ -186,7 +183,7 @@ class Helper:
pdb.set_trace()
raise Exception(
"%s did not appear on message bus after %i seconds." % (
- self.BUS_NAME, REASONABLE_TIMEOUT))
+ self.BUS_NAME, REASONABLE_TIMEOUT))
self.abort_if_process_exits_with_status_0 = False
@@ -238,8 +235,8 @@ class StoreHelper (Helper):
graph_updated_handler_id = 0
- def start(self):
- Helper.start(self)
+ def start(self, dbus_address):
+ Helper.start(self, dbus_address)
tracker = self.bus.get_object(cfg.TRACKER_BUSNAME,
cfg.TRACKER_OBJ_PATH)
@@ -635,8 +632,8 @@ class MinerFsHelper (Helper):
if cfg.haveMaemo:
FLAGS.append('--disable-miner=userguides')
- def start(self):
- Helper.start(self)
+ def start(self, dbus_address):
+ Helper.start(self, dbus_address)
bus_object = self.bus.get_object(cfg.MINERFS_BUSNAME,
cfg.MINERFS_OBJ_PATH)
diff --git a/tests/functional-tests/common/utils/storetest.py b/tests/functional-tests/common/utils/storetest.py
index b585b9184..686471b72 100644
--- a/tests/functional-tests/common/utils/storetest.py
+++ b/tests/functional-tests/common/utils/storetest.py
@@ -27,20 +27,24 @@ from common.utils import configuration as cfg
import unittest as ut
+import common
-class CommonTrackerStoreTest (ut.TestCase):
-
- """
- Common superclass for tests that just require a fresh store running
- """
- @classmethod
- def setUpClass(self):
- # print "Starting the daemon in test mode"
- self.system = TrackerSystemAbstraction()
- self.system.tracker_store_testing_start()
- self.tracker = self.system.store
-
- @classmethod
- def tearDownClass(self):
- # print "Stopping the daemon in test mode (Doing nothing now)"
- self.system.tracker_store_testing_stop()
+
+class CommonTrackerStoreTest (common.testcase.TrackerTestCase):
+
+ """
+ Common superclass for tests that just require a fresh store running
+ """
+
+ def setUp(self):
+ super(CommonTrackerStoreTest, self).setUp()
+
+ self.system = TrackerSystemAbstraction()
+ self.system.tracker_store_testing_start(
+ dbus_address=self.dbus_address)
+ self.tracker = self.system.store
+
+ def tearDown(self):
+ self.system.tracker_store_testing_stop()
+
+ super(CommonTrackerStoreTest, self).tearDown()
diff --git a/tests/functional-tests/common/utils/system.py b/tests/functional-tests/common/utils/system.py
index 539d5de19..bcbe49975 100644
--- a/tests/functional-tests/common/utils/system.py
+++ b/tests/functional-tests/common/utils/system.py
@@ -80,15 +80,15 @@ class TrackerSystemAbstraction:
for key, value in contents.iteritems():
dconf.write(key, value)
- def tracker_store_testing_start(self, confdir=None, ontodir=None):
+ def tracker_store_testing_start(self, config=None, ontodir=None, dbus_address=None):
"""
Stops any previous instance of the store, calls set_up_environment,
and starts a new instances of the store
"""
- self.set_up_environment(confdir, ontodir)
+ self.set_up_environment(config, ontodir)
self.store = helpers.StoreHelper()
- self.store.start()
+ self.store.start(dbus_address)
def tracker_store_start(self):
self.store.start()
@@ -151,22 +151,21 @@ class TrackerSystemAbstraction:
assert self.store
self.store.stop()
- def tracker_miner_fs_testing_start(self, confdir=None):
+ def tracker_miner_fs_testing_start(self, config, dbus_address):
"""
Stops any previous instance of the store and miner, calls set_up_environment,
and starts a new instance of the store and miner-fs
"""
- self.set_up_environment(confdir, None)
+ self.set_up_environment(config, None)
- # Start also the store. DBus autoactivation ignores the env variables.
self.store = helpers.StoreHelper()
- self.store.start()
+ self.store.start(dbus_address)
self.extractor = helpers.ExtractorHelper()
- self.extractor.start()
+ self.extractor.start(dbus_address)
self.miner_fs = helpers.MinerFsHelper()
- self.miner_fs.start()
+ self.miner_fs.start(dbus_address)
def tracker_miner_fs_testing_stop(self):
"""
@@ -176,20 +175,21 @@ class TrackerSystemAbstraction:
self.miner_fs.stop()
self.store.stop()
- def tracker_writeback_testing_start(self, confdir=None):
+ def tracker_writeback_testing_start(self, config, dbus_address):
# Start the miner-fs (and store) and then the writeback process
- self.tracker_miner_fs_testing_start(confdir)
+ self.tracker_miner_fs_testing_start(config, dbus_address)
self.writeback = helpers.WritebackHelper()
- self.writeback.start()
+ self.writeback.start(dbus_address)
def tracker_writeback_testing_stop(self):
# Tracker write must have been started before
self.writeback.stop()
+
self.tracker_miner_fs_testing_stop()
- def tracker_all_testing_start(self, confdir=None):
+ def tracker_all_testing_start(self, config, dbus_address):
# This will start all miner-fs, store and writeback
- self.tracker_writeback_testing_start(confdir)
+ self.tracker_writeback_testing_start(config, dbus_address)
def tracker_all_testing_stop(self):
# This will stop all miner-fs, store and writeback
diff --git a/tests/functional-tests/common/utils/writebacktest.py b/tests/functional-tests/common/utils/writebacktest.py
index 677570f7e..05156d5ef 100644
--- a/tests/functional-tests/common/utils/writebacktest.py
+++ b/tests/functional-tests/common/utils/writebacktest.py
@@ -28,6 +28,9 @@ from common.utils import configuration as cfg
from common.utils.helpers import log
import time
+import common
+
+
TEST_FILE_JPEG = "writeback-test-1.jpeg"
TEST_FILE_TIFF = "writeback-test-2.tif"
TEST_FILE_PNG = "writeback-test-4.png"
@@ -49,7 +52,7 @@ def uri(filename):
return "file://" + os.path.join(WRITEBACK_TMP_DIR, filename)
-class CommonTrackerWritebackTest (ut.TestCase):
+class CommonTrackerWritebackTest (common.TestCase):
"""
Superclass to share methods. Shouldn't be run by itself.
diff --git a/tests/functional-tests/store/200-backup-restore.py b/tests/functional-tests/store/test_backup_restore.py
index 6d58f5ba1..6d58f5ba1 100755..100644
--- a/tests/functional-tests/store/200-backup-restore.py
+++ b/tests/functional-tests/store/test_backup_restore.py
diff --git a/tests/functional-tests/store/05-coalesce.py b/tests/functional-tests/store/test_coalesce.py
index 63380147d..b90f6aeed 100755..100644
--- a/tests/functional-tests/store/05-coalesce.py
+++ b/tests/functional-tests/store/test_coalesce.py
@@ -38,6 +38,8 @@ class TestCoalesce (CommonTrackerStoreTest):
"""
def setUp(self):
+ super(TestCoalesce, self).setUp()
+
self.resource_uri = "contact://test_group_concat"
#
@@ -57,6 +59,8 @@ class TestCoalesce (CommonTrackerStoreTest):
""" % (self.resource_uri)
self.tracker.update(delete)
+ super(TestCoalesce, self).tearDown()
+
def test_coalesce_first_fine(self):
"""
setUp: Insert a contact with only some text properties set
diff --git a/tests/functional-tests/store/16-collation.py b/tests/functional-tests/store/test_collation.py
index 8be6cdf02..ed8a46ee6 100755..100644
--- a/tests/functional-tests/store/16-collation.py
+++ b/tests/functional-tests/store/test_collation.py
@@ -43,13 +43,14 @@ class TrackerStoreCollationTests (CommonTrackerStoreTest):
Each test append to this list the used URIS, so they can be removed
in the tearDown
"""
+ super(TrackerStoreCollationTests, self).setUp()
self.clean_up_instances = []
def tearDown(self):
for uri in self.clean_up_instances:
self.tracker.update("DELETE { <%s> a rdfs:Resource. }" % (uri))
self.clean_up_instances = []
- time.sleep(1)
+ super(TrackerStoreCollationTests, self).tearDown()
def __insert_text(self, text):
uri = "test://collation-01-%d" % (random.randint(1, 1000))
diff --git a/tests/functional-tests/store/09-concurrent-query.py b/tests/functional-tests/store/test_concurrent_query.py
index 57a00c4bb..2cfca60ca 100755..100644
--- a/tests/functional-tests/store/09-concurrent-query.py
+++ b/tests/functional-tests/store/test_concurrent_query.py
@@ -47,6 +47,8 @@ class TestConcurrentQuery (CommonTrackerStoreTest):
"""
def setUp(self):
+ super(TestConcurrentQuery, self).setUp()
+
self.main_loop = GObject.MainLoop()
self.mock_data_insert()
@@ -60,6 +62,8 @@ class TestConcurrentQuery (CommonTrackerStoreTest):
query += "}"
self.tracker.update(query)
+ super(TestConcurrentQuery, self).tearDown()
+
def mock_data_delete(self):
query = "DELETE {\n"
for i in range(0, AMOUNT_OF_TEST_INSTANCES):
diff --git a/tests/functional-tests/store/06-distance.py b/tests/functional-tests/store/test_distance.py
index bd1993329..4a09ad447 100755..100644
--- a/tests/functional-tests/store/06-distance.py
+++ b/tests/functional-tests/store/test_distance.py
@@ -40,6 +40,8 @@ class TestDistanceFunctions (CommonTrackerStoreTest):
"""
def setUp(self):
+ super(TestDistanceFunctions, self).setUp()
+
self.counter = 0
for lat, log in POINT_COORDS:
insert = """
@@ -61,6 +63,8 @@ class TestDistanceFunctions (CommonTrackerStoreTest):
""" % ("point://test/point/" + str (i))
self.tracker.update(delete)
+ super(TestDistanceFunctions, self).tearDown()
+
def get_distance_between_points(self, sum_func, id1, id2):
assert 0 <= id1 <= len(POINT_COORDS)
diff --git a/tests/functional-tests/store/03-fts-functions.py b/tests/functional-tests/store/test_fts_functions.py
index 4459538a9..4459538a9 100755..100644
--- a/tests/functional-tests/store/03-fts-functions.py
+++ b/tests/functional-tests/store/test_fts_functions.py
diff --git a/tests/functional-tests/store/07-graph.py b/tests/functional-tests/store/test_graph.py
index c43ca54dc..c43ca54dc 100755..100644
--- a/tests/functional-tests/store/07-graph.py
+++ b/tests/functional-tests/store/test_graph.py
diff --git a/tests/functional-tests/store/04-group-concat.py b/tests/functional-tests/store/test_group_concat.py
index eadc7c6e2..eadc7c6e2 100755..100644
--- a/tests/functional-tests/store/04-group-concat.py
+++ b/tests/functional-tests/store/test_group_concat.py
diff --git a/tests/functional-tests/store/01-insertion.py b/tests/functional-tests/store/test_insertion.py
index 8eb58a6c6..8eb58a6c6 100755..100644
--- a/tests/functional-tests/store/01-insertion.py
+++ b/tests/functional-tests/store/test_insertion.py
diff --git a/tests/functional-tests/store/17-ontology-changes.py b/tests/functional-tests/store/test_ontology_changes.py
index 3728b5967..a38cc2d3e 100755..100644
--- a/tests/functional-tests/store/17-ontology-changes.py
+++ b/tests/functional-tests/store/test_ontology_changes.py
@@ -33,6 +33,8 @@ from common.utils.system import UnableToBootException as UnableToBootException
from common.utils.helpers import StoreHelper as StoreHelper
from common.utils.expectedFailure import expectedFailureBug, expectedFailureJournal
+import common
+
RDFS_RANGE = "http://www.w3.org/2000/01/rdf-schema#range"
XSD_DATETIME = "http://www.w3.org/2001/XMLSchema#dateTime"
@@ -45,7 +47,7 @@ import re
import time
-class OntologyChangeTestTemplate (ut.TestCase):
+class OntologyChangeTestTemplate (common.testcase.TrackerTestCase):
"""
Template class for the ontology changes tests. The tests are subclasses
@@ -70,11 +72,15 @@ class OntologyChangeTestTemplate (ut.TestCase):
"test-ontologies", param)
def setUp(self):
+ super(OntologyChangeTestTemplate, self).setUp()
+
self.system = TrackerSystemAbstraction()
def tearDown(self):
self.system.tracker_store_testing_stop()
+ super(OntologyChangeTestTemplate, self).tearDown()
+
def template_test_ontology_change(self):
self.set_ontology_dirs()
diff --git a/tests/functional-tests/store/14-signals.py b/tests/functional-tests/store/test_signals.py
index 4b49c5259..bf2f6979a 100755..100644
--- a/tests/functional-tests/store/14-signals.py
+++ b/tests/functional-tests/store/test_signals.py
@@ -51,6 +51,8 @@ class TrackerStoreSignalsTests (CommonTrackerStoreTest):
"""
def setUp(self):
+ super(TrackerStoreSignalsTests, self).setUp()
+
self.clean_up_list = []
self.loop = GObject.MainLoop()
dbus_loop = DBusGMainLoop(set_as_default=True)
@@ -67,6 +69,8 @@ class TrackerStoreSignalsTests (CommonTrackerStoreTest):
self.clean_up_list = []
+ super(TrackerStoreSignalsTests, self).tearDown()
+
def __connect_signal(self):
"""
After connecting to the signal, call self.__wait_for_signal.
diff --git a/tests/functional-tests/store/02-sparql-bugs.py b/tests/functional-tests/store/test_sparql_bugs.py
index 655f94597..655f94597 100755..100644
--- a/tests/functional-tests/store/02-sparql-bugs.py
+++ b/tests/functional-tests/store/test_sparql_bugs.py
diff --git a/tests/functional-tests/store/11-sqlite-batch-misused.py b/tests/functional-tests/store/test_sqlite_batch_misused.py
index 6f6cfd0a2..6f6cfd0a2 100755..100644
--- a/tests/functional-tests/store/11-sqlite-batch-misused.py
+++ b/tests/functional-tests/store/test_sqlite_batch_misused.py
diff --git a/tests/functional-tests/store/10-sqlite-misused.py b/tests/functional-tests/store/test_sqlite_misused.py
index 352d4b363..58e7cc8be 100755..100644
--- a/tests/functional-tests/store/10-sqlite-misused.py
+++ b/tests/functional-tests/store/test_sqlite_misused.py
@@ -38,6 +38,8 @@ class TestSqliteMisused (CommonTrackerStoreTest):
"""
def setUp(self):
+ super(CommonTrackerStoreTest, self).setUp()
+
self.main_loop = GObject.MainLoop()
self.files_counter = 0
diff --git a/tests/functional-tests/store/15-statistics.py b/tests/functional-tests/store/test_statistics.py
index af9dee5c8..86c2ce07e 100755..100644
--- a/tests/functional-tests/store/15-statistics.py
+++ b/tests/functional-tests/store/test_statistics.py
@@ -50,13 +50,16 @@ class TrackerStoreStatisticsTests (CommonTrackerStoreTest):
Each test append to this list the used URIS, so they can be removed
in the tearDown
"""
+ super(TrackerStoreStatisticsTests, self).setUp()
+
self.clean_up_instances = []
def tearDown(self):
for uri in self.clean_up_instances:
self.tracker.update("DELETE { <%s> a rdfs:Resource. }" % (uri))
self.clean_up_instances = []
- time.sleep(1)
+
+ super(TrackerStoreStatisticsTests, self).tearDown()
def test_stats_01_insert_base_class(self):
self.clean_up_instances.append("test://stats-01")
diff --git a/tests/functional-tests/store/13-threaded-store.py b/tests/functional-tests/store/test_threaded_store.py
index 993a8c814..5bc68298f 100755..100644
--- a/tests/functional-tests/store/13-threaded-store.py
+++ b/tests/functional-tests/store/test_threaded_store.py
@@ -51,6 +51,8 @@ class TestThreadedStore (CommonTrackerStoreTest):
"""
def setUp(self):
+ super(TestThreadedStore, self).setUp()
+
self.main_loop = GObject.MainLoop()
self.simple_queries_counter = AMOUNT_SIMPLE_QUERIES
self.simple_queries_answers = 0
diff --git a/tests/functional-tests/store/12-transactions.py b/tests/functional-tests/store/test_transactions.py
index 33b9bdccd..1f3ef95bf 100755..100644
--- a/tests/functional-tests/store/12-transactions.py
+++ b/tests/functional-tests/store/test_transactions.py
@@ -43,6 +43,8 @@ class TrackerTransactionsTest (CommonTrackerStoreTest):
"""
def setUp(self):
+ super(TrackerTransactionsTest, self).setUp()
+
self.instance_counter = 0
def tearDown(self):
@@ -52,6 +54,8 @@ class TrackerTransactionsTest (CommonTrackerStoreTest):
timeout=60000)
self.instance_counter = 0
+ super(TrackerTransactionsTest, self).tearDown()
+
def insert_and_commit(self, number):
insert_sparql = "INSERT {\n"
for i in range(0, number):
diff --git a/tests/functional-tests/store/08-unique-insertions.py b/tests/functional-tests/store/test_unique_insertions.py
index 88929cef6..88929cef6 100755..100644
--- a/tests/functional-tests/store/08-unique-insertions.py
+++ b/tests/functional-tests/store/test_unique_insertions.py