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

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

src/d/h/DHTBot-HEAD/dhtbot/test/kademlia/test_routing_table.py   DHTBot(Download)
        rt = TreeRoutingTable(node_id=17)
        rt.active_kbuckets.append(tnode.kbucket)
        split_correctly = rt._split(tnode)
        self.assertTrue(split_correctly)
        self.assertEquals(1, len(tnode.lchild.kbucket.get_nodes()))
        rt = TreeRoutingTable(node_id=12)
        rt.active_kbuckets.append(tnode.kbucket)
        split_correctly = rt._split(tnode)
        self.assertTrue(split_correctly)
        # Treenode has already been split (so it isnt a leaf)
        split_correctly = rt._split(tnode)
        rt = TreeRoutingTable(node_id=2)
        rt.active_kbuckets.append(tnode.kbucket)
        split_correctly = rt._split(tnode)
        self.assertFalse(split_correctly)
 
        rt.active_kbuckets.append(tnode.kbucket)
        # 122 doesnt fit in [0, 16)
        split_correctly = rt._split(tnode)
        self.assertFalse(split_correctly)