diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-01 21:08:45 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-01 21:08:52 +0300 |
commit | aa0c9867b27cca4cff7d7083cda345928160044c (patch) | |
tree | f250fbf74d31c056c4546e382a4bd8c4be9bb270 /tests/python | |
parent | e9cf3fae8e2b5c419bdafcbe312483ce0c38552e (diff) |
unittests: Update (fix) unittests after workspace API change
Tests were broken since e8c15e0ed15f8369d.
We now get view_layer from window, not workspace, since the same workspace can
have a different view_layer depending on the window scene.
Diffstat (limited to 'tests/python')
15 files changed, 27 insertions, 27 deletions
diff --git a/tests/python/view_layer/test_evaluation_selectability_a.py b/tests/python/view_layer/test_evaluation_selectability_a.py index 4dba8ab224d..82404d54fe3 100644 --- a/tests/python/view_layer/test_evaluation_selectability_a.py +++ b/tests/python/view_layer/test_evaluation_selectability_a.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Selectability Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_selectability_b.py b/tests/python/view_layer/test_evaluation_selectability_b.py index 9cb2cd76f17..f05ab5de2e1 100644 --- a/tests/python/view_layer/test_evaluation_selectability_b.py +++ b/tests/python/view_layer/test_evaluation_selectability_b.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Selectability Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_selectability_c.py b/tests/python/view_layer/test_evaluation_selectability_c.py index 9536aaf4edc..71452bc1354 100644 --- a/tests/python/view_layer/test_evaluation_selectability_c.py +++ b/tests/python/view_layer/test_evaluation_selectability_c.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Selectability Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_selectability_d.py b/tests/python/view_layer/test_evaluation_selectability_d.py index ddfec6132e6..529a36c101e 100644 --- a/tests/python/view_layer/test_evaluation_selectability_d.py +++ b/tests/python/view_layer/test_evaluation_selectability_d.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Selectability Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_selectability_e.py b/tests/python/view_layer/test_evaluation_selectability_e.py index 02017321734..a26fa0df304 100644 --- a/tests/python/view_layer/test_evaluation_selectability_e.py +++ b/tests/python/view_layer/test_evaluation_selectability_e.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Selectability Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_visibility_a.py b/tests/python/view_layer/test_evaluation_visibility_a.py index ad9b92dd937..3ae567df82c 100644 --- a/tests/python/view_layer/test_evaluation_visibility_a.py +++ b/tests/python/view_layer/test_evaluation_visibility_a.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Visibility Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene.master_collection.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_visibility_b.py b/tests/python/view_layer/test_evaluation_visibility_b.py index 1a3c6605027..93ace3928f2 100644 --- a/tests/python/view_layer/test_evaluation_visibility_b.py +++ b/tests/python/view_layer/test_evaluation_visibility_b.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Visibility Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_visibility_c.py b/tests/python/view_layer/test_evaluation_visibility_c.py index 7285c1cdea5..05db8577167 100644 --- a/tests/python/view_layer/test_evaluation_visibility_c.py +++ b/tests/python/view_layer/test_evaluation_visibility_c.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Visibility Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_visibility_d.py b/tests/python/view_layer/test_evaluation_visibility_d.py index ed5d452e4ca..e08ab4d571e 100644 --- a/tests/python/view_layer/test_evaluation_visibility_d.py +++ b/tests/python/view_layer/test_evaluation_visibility_d.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Visibility Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_visibility_e.py b/tests/python/view_layer/test_evaluation_visibility_e.py index 006836f27b9..b54238337c6 100644 --- a/tests/python/view_layer/test_evaluation_visibility_e.py +++ b/tests/python/view_layer/test_evaluation_visibility_e.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Visibility Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_evaluation_visibility_f.py b/tests/python/view_layer/test_evaluation_visibility_f.py index bc0050d8efa..e532a19e3ef 100644 --- a/tests/python/view_layer/test_evaluation_visibility_f.py +++ b/tests/python/view_layer/test_evaluation_visibility_f.py @@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting): import bpy scene = bpy.context.scene - workspace = bpy.context.workspace + window = bpy.context.window cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh')) layer = scene.view_layers.new('Visibility Test') layer.collections.unlink(layer.collections[0]) scene.view_layers.active = layer - workspace.view_layer = layer + window.view_layer = layer scene_collection_mom = scene.master_collection.collections.new("Mom") scene_collection_kid = scene_collection_mom.collections.new("Kid") diff --git a/tests/python/view_layer/test_object_copy.py b/tests/python/view_layer/test_object_copy.py index eab2c73f3b3..a15b9e2c941 100644 --- a/tests/python/view_layer/test_object_copy.py +++ b/tests/python/view_layer/test_object_copy.py @@ -42,7 +42,7 @@ class UnitTesting(ViewLayerTesting): layer.collections.link(subzero) scene.view_layers.active_index = len(scene.view_layers) - 1 - bpy.context.workspace.view_layer = bpy.context.scene.view_layers['Fresh new Layer'] + bpy.context.window.view_layer = bpy.context.scene.view_layers['Fresh new Layer'] if mode == 'DUPLICATE': # assuming the latest layer is the active layer diff --git a/tests/python/view_layer/test_object_link_b.py b/tests/python/view_layer/test_object_link_b.py index 3a7f9438071..361ea7fc3a5 100644 --- a/tests/python/view_layer/test_object_link_b.py +++ b/tests/python/view_layer/test_object_link_b.py @@ -20,7 +20,7 @@ class UnitTesting(ViewLayerTesting): """ import bpy bpy.context.scene.view_layers.active_index = len(bpy.context.scene.view_layers) - 1 - bpy.context.workspace.view_layer = bpy.context.scene.view_layers['Viewport'] + bpy.context.window.view_layer = bpy.context.scene.view_layers['Viewport'] master_collection = bpy.context.scene_collection self.do_object_link(master_collection) diff --git a/tests/python/view_layer/test_operator_context.py b/tests/python/view_layer/test_operator_context.py index 4c665b1d960..ff751bc0fa5 100644 --- a/tests/python/view_layer/test_operator_context.py +++ b/tests/python/view_layer/test_operator_context.py @@ -88,11 +88,11 @@ class UnitTesting(ViewLayerTesting): layer.collections.active_index = 3 self.assertEqual(layer.collections.active.name, 'scorpion') - # Change active scene layer (do it for workspace too just to don't get mangled in workspace bugs) + # Change active scene layer (do it for window too just to don't get mangled in window bugs) scene = bpy.context.scene scene.view_layers.active_index = len(scene.view_layers) - 2 self.assertEqual(scene.view_layers.active.name, "Viewport") - bpy.context.workspace.view_layer = bpy.context.scene.view_layers['Viewport'] + bpy.context.window.view_layer = bpy.context.scene.view_layers['Viewport'] # old layer self.assertEqual(bpy.ops.testing.sample(view_layer='Viewport', use_verbose=True), {'FINISHED'}) diff --git a/tests/python/view_layer/view_layer_common.py b/tests/python/view_layer/view_layer_common.py index 166d683da5a..1d9d321e532 100644 --- a/tests/python/view_layer/view_layer_common.py +++ b/tests/python/view_layer/view_layer_common.py @@ -760,7 +760,7 @@ class Clay: layer = self._scene.view_layers.new('Evaluation Test') layer.collections.unlink(layer.collections[0]) self._scene.view_layers.active = layer - bpy.context.workspace.view_layer = layer + bpy.context.window.view_layer = layer # remove all other layers for layer_iter in self._scene.view_layers: |