Commit a652eab3 authored by Sam Thursfield's avatar Sam Thursfield

functional-tests: Some cleanups of writeback tests

These work better than before, but still not well enough yet.
parent 31a1b586
......@@ -24,7 +24,8 @@ on the files. Note that these tests are highly platform dependant.
import os
import time
from common.utils.extractor import get_tracker_extract_output
from common.utils.extractor import get_tracker_extract_jsonld_output
from common.utils.helpers import log
from common.utils.writebacktest import CommonTrackerWritebackTest as CommonTrackerWritebackTest
import unittest2 as ut
from common.utils.expectedFailure import expectedFailureBug
......@@ -82,9 +83,11 @@ class WritebackBasicDataTest (CommonTrackerWritebackTest):
self.__clean_property (prop, filename)
self.tracker.update (SPARQL_TMPL % (prop, TEST_VALUE, filename))
log("Waiting for change on %s" % filename_real)
self.wait_for_file_change(filename_real, initial_mtime)
log("Got the change")
results = get_tracker_extract_output (filename, mimetype)
results = get_tracker_extract_jsonld_output (filename, mimetype)
keyDict = expectedKey or prop
self.assertIn (TEST_VALUE, results[keyDict])
self.__clean_property (prop, filename, False)
......@@ -116,7 +119,7 @@ class WritebackBasicDataTest (CommonTrackerWritebackTest):
time.sleep (REASONABLE_TIMEOUT)
results = get_tracker_extract_output (filename, mimetype)
results = get_tracker_extract_jsonld_output (filename, mimetype)
self.assertIn ("testTag", results ["nao:hasTag"])
......@@ -181,4 +184,4 @@ class WritebackBasicDataTest (CommonTrackerWritebackTest):
self.__writeback_hasTag_test (self.get_test_filaname_png (), "image/png")
if __name__ == "__main__":
ut.main ()
ut.main (failfast=True)
......@@ -18,7 +18,7 @@
# Boston, MA 02110-1301, USA.
#
from common.utils.writebacktest import CommonTrackerWritebackTest as CommonTrackerWritebackTest
from common.utils.extractor import get_tracker_extract_output
from common.utils.extractor import get_tracker_extract_jsonld_output
from common.utils.helpers import log
import unittest2 as ut
from common.utils.expectedFailure import expectedFailureBug
......@@ -85,7 +85,7 @@ class WritebackKeepDateTest (CommonTrackerWritebackTest):
self.wait_for_file_change (filename, initial_mtime)
# Check the value is written in the file
metadata = get_tracker_extract_output (filename, "")
metadata = get_tracker_extract_jsonld_output (filename, "")
self.assertIn (self.favorite, metadata ["nao:hasTag"],
"Tag hasn't been written in the file")
......
......@@ -41,6 +41,9 @@ CONF_OPTIONS = {
'index-single-directories': GLib.Variant.new_strv([]),
'index-optical-discs': GLib.Variant.new_boolean(False),
'index-removable-devices': GLib.Variant.new_boolean(False),
},
'org.freedesktop.Tracker.Store': {
'graphupdated-delay': GLib.Variant.new_int32(100)
}
}
......@@ -102,6 +105,7 @@ class CommonTrackerWritebackTest (ut.TestCase):
def tearDownClass (self):
#print "Stopping the daemon in test mode (Doing nothing now)"
self.system.tracker_writeback_testing_stop ()
log ("Test finished")
@staticmethod
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment