[tracker-miners/sam/test-runner-fix: 26/33] functional-tests: await_property_changed() should look for deletes too



commit 5f28d3d2ee61d9fef49e946c16557abea4b4f49a
Author: Sam Thursfield <sam afuera me uk>
Date:   Fri Jan 4 21:48:02 2019 +0100

    functional-tests: await_property_changed() should look for deletes too
    
    This fixes the 410-extractor-decorator test.

 tests/functional-tests/common/utils/helpers.py | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/tests/functional-tests/common/utils/helpers.py b/tests/functional-tests/common/utils/helpers.py
index 4e1d45203..a9fe685fb 100644
--- a/tests/functional-tests/common/utils/helpers.py
+++ b/tests/functional-tests/common/utils/helpers.py
@@ -460,30 +460,32 @@ class StoreHelper (Helper):
 
         property_id = self.get_resource_id_by_uri(property_uri)
 
-        def find_property_change (inserts_list):
+        def find_property_change (event_list):
             matched = False
             remaining_events = []
 
-            for insert in inserts_list:
-                if insert[1] == subject_id and insert[2] == property_id:
-                    log("Matched property change: %s" % str(insert))
+            for event in event_list:
+                if event[1] == subject_id and event[2] == property_id:
+                    log("Matched property change: %s" % str(event))
                     matched = True
                 else:
-                    remaining_events += [insert]
+                    remaining_events += [event]
 
             return matched, remaining_events
 
-        def match_cb (inserts_list):
-            matched, remaining_events = find_property_change (inserts_list)
+        def match_cb (event_list):
+            matched, remaining_events = find_property_change (event_list)
             exit_loop = matched
             return exit_loop, remaining_events
 
         # 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:
             self._enable_await_timeout ()
             self.inserts_match_function = match_cb
+            self.deletes_match_function = match_cb
             # Run the event loop until the correct notification arrives
             try:
                 self.loop.run_checked ()
@@ -491,6 +493,7 @@ class StoreHelper (Helper):
                 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
 
     def query (self, query, timeout=5000, **kwargs):


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