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

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

src/d/h/DHTBot-HEAD/dhtbot/test/kademlia/test_routing_table.py   DHTBot(Download)
        tnode.kbucket.offer_node(generate_node(22))
        rt = TreeRoutingTable(node_id=17)
        rt.active_kbuckets.append(tnode.kbucket)
        split_correctly = rt._split(tnode)
        self.assertTrue(split_correctly)
    def test_split_invalidNotLeaf(self):
        k = KBucket(range_min=0, range_max=32, maxsize=2)
        tnode = _TreeNode(k)
        rt = TreeRoutingTable(node_id=12)
        rt.active_kbuckets.append(tnode.kbucket)
        tnode = _TreeNode(k)
        rt = TreeRoutingTable(node_id=2)
        rt.active_kbuckets.append(tnode.kbucket)
        split_correctly = rt._split(tnode)
        self.assertFalse(split_correctly)
    def test_split_invalidNodeID(self):
        k = KBucket(range_min=0, range_max=16, maxsize=2)
        tnode = _TreeNode(k)
        rt = TreeRoutingTable(node_id=122)
        rt.active_kbuckets.append(tnode.kbucket)