def visit_all_xml(self): self.visited = {} with asserts.Check() as check: r = self.visit_page(check, '', '', accepts='application/xml', regex='href=\"([^\"]+)') self.log.info('DONE!! Visited %d pages' % len(self.visited))
def check_message(self, resource_id, event_type, **attrs): messages = utils.poll_until(lambda: self.get_messages(resource_id), lambda x: len(x) > 0, time_out=30) found = None for message in messages: if message['event_type'] == event_type: found = message asserts.assert_is_not_none(found, "No message type %s for resource %s" % (event_type, resource_id)) with asserts.Check() as check: for key, value in attrs.iteritems(): check.equal(found[key], value)