Ejemplo n.º 1
0
 def test_add_ext_node(self):
     """Test GDScene.add_ext_node"""
     scene = GDScene()
     res = scene.add_ext_resource("res://Other.tscn", "PackedScene")
     node = scene.add_ext_node("Root", res.id)
     self.assertEqual(node.name, "Root")
     self.assertEqual(node.instance, res.id)
Ejemplo n.º 2
0
 def test_missing_root(self):
     """ Raise exception when GDScene is inherited but missing project_root """
     scene = GDScene()
     scene.add_ext_node("Root", 1)
     self.assertRaises(RuntimeError, lambda: scene.get_node("Root"))