Beispiel #1
0
 def __init__(self, node, url):
     """
     :param node: The AMQP node to read.
     :type node: gofer.messaging.adapter.model.Node
     :param url: The broker url.
     :type url: str
     :see: gofer.messaging.adapter.url.URL
     """
     BaseReader.__init__(self, node, url)
     self.connection = Connection(url)
     self.receiver = None
Beispiel #2
0
 def __init__(self, node, url):
     """
     :param node: The AMQP node to read.
     :type node: gofer.messaging.adapter.model.Node
     :param url: The broker url.
     :type url: str
     :see: gofer.messaging.adapter.url.URL
     """
     BaseReader.__init__(self, node, url)
     self.connection = Connection(url)
     self.receiver = None
Beispiel #3
0
 def test_abstract(self):
     url = TEST_URL
     node = Node('test')
     reader = BaseReader(node, url)
     self.assertRaises(NotImplementedError, reader.get, 10)
     self.assertRaises(NotImplementedError, reader.ack, '')
     self.assertRaises(NotImplementedError, reader.reject, '')
Beispiel #4
0
 def test_init(self):
     node = Node('')
     url = TEST_URL
     reader = BaseReader(node, url)
     self.assertEqual(reader.node, node)
     self.assertEqual(reader.url, url)
     self.assertTrue(isinstance(reader, Messenger))