Exemplo n.º 1
0
 def test_get_contact(self):
     """
     Ensures that the correct contact is returned.
     """
     parent_node_id = 'abc'
     r = RoutingTable(parent_node_id)
     contact1 = Contact('a', '192.168.0.1', 9999, self.version, 0)
     r.add_contact(contact1)
     result = r.get_contact('a')
     self.assertEqual(contact1, result)
Exemplo n.º 2
0
 def test_get_contact(self):
     """
     Ensures that the correct contact is returned.
     """
     parent_node_id = 'deadbeef'
     r = RoutingTable(parent_node_id)
     contact1 = PeerNode(PUBLIC_KEY, self.version,
                         'netstring://192.168.0.1:9999/', 0)
     contact1.network_id = 'a'
     r.add_contact(contact1)
     result = r.get_contact('a')
     self.assertEqual(contact1, result)