code: def testTreeGame(self):
      # Prufer algorithm
      g = Graph.Tree_Game(10, False, "Prufer")
      self.assertTrue(isinstance(g, Graph) and g.vcount() == 10)
      self.assertFalse(g.is_directed())
      self.assertTrue(g.is_tree())
  
      # Prufer with directed (should fail)
      self.assertRaises(
          InternalError, Graph.Tree_Game, 10, True, "Prufer"
      )
  
      # LERW algorithm
      g = Graph.Tree_Game(10, False, "lerw")
      self.assertTrue(isinstance(g, Graph) and g.vcount() == 10)
      self.assertFalse(g.is_directed())
      self.assertTrue(g.is_tree())
  
      # Omitting the algorithm should default to LERW
      g = Graph.Tree_Game(10, directed=True)
      self.assertTrue(isinstance(g, Graph) and g.vcount() == 10)
      self.assertTrue(g.is_directed())
      self.assertTrue(g.is_tree())
  
      # Omitting the directed argument should use undirected graphs
      g = Graph.Tree_Game(42, method="Prufer")
      self.assertTrue(isinstance(g, Graph) and g.vcount() == 42)
      self.assertFalse(g.is_directed())
      self.assertTrue(g.is_tree())
  
file_path: python-igraph/tests/test_games.py
imports: import unittest
  from igraph import Graph, InternalError, Layout
label_desc: Use image node_id 6 for calling the GameTests obj's underlying member method code with example usage: obj.testTreeGame() without return types