Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)

src/d/a/Dandelion-Message-Service-HEAD/dandelionpy/dandelion/test/service_test.py   Dandelion-Message-Service(Download)
 
        # Add the node
        d.add_node("127.0.0.1", 1234)
        self.assertTrue(d.contains_node("127.0.0.1", 1234))
 
        self.assertRaises(dandelion.discoverer.DiscovererException, d.acquire_node)
 
        d.add_node("127.0.0.1", 1234)
 
        # We should get the only available node
 
        # The out-of-sync case
        d.add_node("127.0.0.1", 1234)
        ip, port = d.acquire_node()
        d.remove_node("127.0.0.1", 1234)
 
        # Not pinned (default)
        d.add_node("127.0.0.1", 1234)
        ip, port = d.acquire_node()
        self.assertEqual(ip, "127.0.0.1")
 
        # Pinned node
        d.add_node("127.0.0.1", 1234, pin=True)
        ip, port = d.acquire_node()
        d.release_node(ip, port, False) # Simulate failed sync (not automatically removed)