summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2019-11-25 15:59:47 +0100
committerCarlos Garnacho <carlosg@gnome.org>2019-12-07 15:18:58 +0100
commit467b687e685f7c58237d9c007b45e004f17b4210 (patch)
tree98c367c7e701d83fbbaa21c98fd41f67aaa8cab2
parent04d715e82c03cb92c9f96f5c5c2cc6be7b8fe804 (diff)
downloadtracker-467b687e685f7c58237d9c007b45e004f17b4210.tar.gz
utils: Fix GraphUpdated checks in trackertestutils
We should check whether there was a match before handling the delete events, as its handling might overwrite the match. Also, this function should unset its transient data on exit, not just on timeout.
-rw-r--r--utils/trackertestutils/helpers.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/trackertestutils/helpers.py b/utils/trackertestutils/helpers.py
index 07b176b9a..037eb032c 100644
--- a/utils/trackertestutils/helpers.py
+++ b/utils/trackertestutils/helpers.py
@@ -338,7 +338,8 @@ class StoreHelper():
# Check the list of previously received events for matches
(existing_match, self.inserts_list) = find_property_change(self.inserts_list)
- (existing_match, self.deletes_list) = find_property_change(self.deletes_list)
+ if not existing_match:
+ (existing_match, self.deletes_list) = find_property_change(self.deletes_list)
if not existing_match:
self._enable_await_timeout()
@@ -350,9 +351,10 @@ class StoreHelper():
except GraphUpdateTimeoutException:
raise GraphUpdateTimeoutException(
"Timeout waiting for property change, subject %i property %s (%i)" % (subject_id, property_uri, property_id))
- self.inserts_match_function = None
- self.deletes_match_function = None
- self.class_to_track = None
+
+ self.inserts_match_function = None
+ self.deletes_match_function = None
+ self.class_to_track = None
# Note: The methods below call the tracker-store D-Bus API directly. This
# is useful for testing this API surface, but we recommand that all regular