[tracker/wip/carlosg/test-fixes: 1/2] utils: Fix GraphUpdated checks in trackertestutils



commit 467b687e685f7c58237d9c007b45e004f17b4210
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Nov 25 15:59:47 2019 +0100

    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.

 utils/trackertestutils/helpers.py | 10 ++++++----
 1 file 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]