Exemplo n.º 1
0
 def next(self, timeout=90):
     """
     Get the next valid *document* from the queue.
     :param timeout: The read timeout in seconds.
     :type timeout: int
     :return: The next document.
     :rtype: tuple: (Message, Document)
     :raises: model.DocumentError
     """
     message = self.get(timeout)
     if message:
         try:
             document = auth.validate(self.authenticator, message.body)
             validate(document)
         except ModelError:
             message.ack()
             raise
         log.debug('read next: %s', document)
         return message, document
     else:
         return None, None
Exemplo n.º 2
0
 def test_valid(self):
     document = Document(version=VERSION)
     validate(document)
Exemplo n.º 3
0
 def test_valid(self):
     document = Document(version=VERSION)
     validate(document)