@@ -212,7 +212,7 @@ def test_scene_representation():
212212 def test_scene_initialization (mocker ):
213213 # Mock context detection at the correct import path
214214 mocker .patch ("compas.scene.scene.detect_current_context" , return_value = "fake" )
215-
215+
216216 # Test default initialization
217217 scene = Scene ()
218218 assert scene .context == "fake"
@@ -259,13 +259,13 @@ def test_scene_context_objects(mocker):
259259 mocker .patch ("compas.scene.scene.detect_current_context" , return_value = "fake" )
260260 scene = Scene (context = "fake" )
261261 register (FakeItem , FakeSceneObject , context = "fake" )
262-
262+
263263 item = FakeItem ()
264264 sceneobj = scene .add (item )
265-
265+
266266 # Mock the _guids attribute to return test guids
267267 sceneobj ._guids = ["guid1" , "guid2" ]
268-
268+
269269 context_objects = scene .context_objects
270270 assert len (context_objects ) == 2
271271 assert "guid1" in context_objects
@@ -290,26 +290,22 @@ def test_scene_find_by_itemtype(mocker):
290290 scene = Scene (context = "fake" )
291291 register (FakeItem , FakeSceneObject , context = "fake" )
292292 register (FakeSubItem , FakeSubSceneObject , context = "fake" )
293-
293+
294294 # Create items and add them to the scene
295295 item1 = FakeItem ()
296296 item2 = FakeSubItem ()
297- sceneobj1 = scene .add (item1 )
298- sceneobj2 = scene .add (item2 )
299-
300- # Ensure the datastore is properly set up
301- scene .datastore [str (item1 .guid )] = item1
302- scene .datastore [str (item2 .guid )] = item2
303-
297+ scene .add (item1 )
298+ scene .add (item2 )
299+
304300 # Find objects by type
305301 found = scene .find_by_itemtype (FakeItem )
306302 assert found is not None
307303 assert found ._item == str (item1 .guid )
308-
304+
309305 found = scene .find_by_itemtype (FakeSubItem )
310306 assert found is not None
311307 assert found ._item == str (item2 .guid )
312-
308+
313309 not_found = scene .find_by_itemtype (str ) # type that doesn't exist in scene
314310 assert not_found is None
315311
@@ -318,29 +314,24 @@ def test_scene_find_all_by_itemtype(mocker):
318314 scene = Scene (context = "fake" )
319315 register (FakeItem , FakeSceneObject , context = "fake" )
320316 register (FakeSubItem , FakeSubSceneObject , context = "fake" )
321-
317+
322318 # Create items and add them to the scene
323319 item1 = FakeItem ()
324320 item2 = FakeSubItem ()
325321 item3 = FakeItem ()
326- sceneobj1 = scene .add (item1 )
327- sceneobj2 = scene .add (item2 )
328- sceneobj3 = scene .add (item3 )
329-
330- # Ensure the datastore is properly set up
331- scene .datastore [str (item1 .guid )] = item1
332- scene .datastore [str (item2 .guid )] = item2
333- scene .datastore [str (item3 .guid )] = item3
334-
322+ scene .add (item1 )
323+ scene .add (item2 )
324+ scene .add (item3 )
325+
335326 # Find all objects by type
336327 found = scene .find_all_by_itemtype (FakeItem )
337328 assert len (found ) == 3
338329 assert all (obj ._item in [str (item1 .guid ), str (item2 .guid ), str (item3 .guid )] for obj in found )
339-
330+
340331 found = scene .find_all_by_itemtype (FakeSubItem )
341332 assert len (found ) == 1
342333 assert all (obj ._item == str (item2 .guid ) for obj in found )
343-
334+
344335 not_found = scene .find_all_by_itemtype (str ) # type that doesn't exist in scene
345336 assert len (not_found ) == 0
346337
0 commit comments