Commit 5d561091 authored by Sam Thursfield's avatar Sam Thursfield

functional-tests: await_property_changed() should look for deletes too

This fixes the 410-extractor-decorator test.
parent cacb5b8c
......@@ -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):
......
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