Exemplo n.º 1
0
 def init(self):
     if self.key:
         self.recp = recipient.Agent(self.key[0], self.key[1])
     else:
         self.recp = recipient.dummy_agent()
     self.key = self.key or (self.recp.key, self.recp.route)
     self.final = True
     self.interest(self.recp.key, final=True)
Exemplo n.º 2
0
    def __init__(self, backend):
        self.backend = backend
        self.messages = list()
        self.recipient = recipient.dummy_agent()

        # recp -> uri
        self.routes = dict()

        self.backend.connect(self)
        self.backend.add_route(self.recipient, self.backend.route)
Exemplo n.º 3
0
 def test_single_host_and_two_rubbish(self):
     self.recipients.insert(0, dummy_agent())
     self.recipients.insert(0, dummy_agent())
     yield self._initiate_resolve(self.recipients)
     self.assert_resolved()
Exemplo n.º 4
0
 def test_missing_in_the_front(self):
     self.recipients.insert(0, dummy_agent())
     yield self._initiate_resolve(self.recipients)
     self.assert_resolved()
Exemplo n.º 5
0
 def _generate_partner(self, factory, role=None):
     recp = recipient.dummy_agent()
     return factory(recp, role=role)