Ejemplo n.º 1
0
 def test_return_nameless(self):
     scene = Scene(None)
     game_objects = [GameObject() for x in range(0, 10)]
     for index,obj in enumerate(game_objects):
         obj.name = None if index % 2 == 0 else "name"
         scene.add_object(obj)
     scene.setup_frame(1.0)
     self.assertEqual([x for x in game_objects if x.name is None], scene.get_objects_by_name(None))
Ejemplo n.º 2
0
 def test_return_named_objects(self):
     scene = Scene(None)
     game_objects = [GameObject() for x in range(0, 10)]
     for index,obj in enumerate(game_objects):
         obj.name = str(index % 2)
         scene.add_object(obj)
     scene.setup_frame(1.0)
     self.assertEqual([x for x in game_objects if int(x.name) % 2 == 0], scene.get_objects_by_name("0"))