Esempio n. 1
0
    def test_06_random_trees(self):
        """Generate 500 random nodes"""
        NUM_NODES = 500
        random_nodes = [random_node(10) for i in xrange(NUM_NODES)]

        self.assertEqual(len(random_nodes), NUM_NODES)
Esempio n. 2
0
def random_tree(max_level=20, min_level=1, current_level=0):
    """generate a random tree of random nodes"""
    return Tree(random_node(max_level, min_level, current_level))