[tracker-miners/sam/index-location: 18/21] Fix tests for IndexFile rename
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/sam/index-location: 18/21] Fix tests for IndexFile rename
- Date: Thu, 9 Jul 2020 23:05:17 +0000 (UTC)
commit 196aa5b53d1755c40192e03b011ca35c65495cb1
Author: Sam Thursfield <sam afuera me uk>
Date: Thu Jul 9 23:39:30 2020 +0200
Fix tests for IndexFile rename
tests/functional-tests/helpers.py | 4 ++--
tests/functional-tests/miner-on-demand.py | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/tests/functional-tests/helpers.py b/tests/functional-tests/helpers.py
index fca42e03b..db6f6da90 100644
--- a/tests/functional-tests/helpers.py
+++ b/tests/functional-tests/helpers.py
@@ -192,9 +192,9 @@ class MinerFsHelper ():
return Tracker.SparqlConnection.bus_new(
'org.freedesktop.Tracker3.Miner.Files', None, self.bus)
- def index_location(self, uri, flags):
+ def index_location(self, uri, flags=None):
log.debug("IndexLocation(%s, %s)", uri, flags)
- return self.index.IndexFile('(sas)', uri, flags)
+ return self.index.IndexLocation('(sas)', uri, flags or [])
def await_file_processed(self, path, status=True):
expected = [FileProcessedResult(path, status)]
diff --git a/tests/functional-tests/miner-on-demand.py b/tests/functional-tests/miner-on-demand.py
index 13281b1bc..95d9a38c6 100755
--- a/tests/functional-tests/miner-on-demand.py
+++ b/tests/functional-tests/miner-on-demand.py
@@ -56,7 +56,7 @@ class MinerOnDemandTest(fixtures.TrackerMinerTest):
with self.await_document_inserted(testfile):
with self.extractor.await_file_processed(testfile):
with self.miner_fs.await_file_processed(testfile):
- self.miner_fs.index_file(testfile.as_uri())
+ self.miner_fs.index_location(testfile.as_uri())
self.assertFileIndexed(testfile.as_uri())
def test_index_file_not_found(self):
@@ -66,7 +66,7 @@ class MinerOnDemandTest(fixtures.TrackerMinerTest):
self.assertFileNotIndexed('file:///test-missing')
with self.assertRaises(GLib.GError) as e:
- self.miner_fs.index_file('file:///test-missing')
+ self.miner_fs.index_location('file:///test-missing')
assert
e.exception.message.startswith('GDBus.Error:org.freedesktop.Tracker.Miner.Files.Index.Error.FileNotFound:')
def await_failsafe_marker_inserted(self, graph, path, timeout=configuration.AWAIT_TIMEOUT):
@@ -87,7 +87,7 @@ class MinerOnDemandTest(fixtures.TrackerMinerTest):
testfile = self.create_test_file('test-not-monitored/invalid.mp3')
with self.extractor.await_file_processed(testfile, False, timeout=configuration.AWAIT_TIMEOUT):
- self.miner_fs.index_file(testfile.as_uri())
+ self.miner_fs.index_location(testfile.as_uri())
def test_index_directory_basic(self):
"""
@@ -114,7 +114,7 @@ class MinerOnDemandTest(fixtures.TrackerMinerTest):
]
with self.miner_fs.await_files_processed(expected):
- self.miner_fs.index_file(testdir.as_uri())
+ self.miner_fs.index_location(testdir.as_uri())
if __name__ == "__main__":
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]