[Bf-blender-cvs] [aa0c9867b27] blender2.8: unittests: Update (fix) unittests after workspace API change
Dalai Felinto
noreply at git.blender.org
Fri Dec 1 19:09:11 CET 2017
Commit: aa0c9867b27cca4cff7d7083cda345928160044c
Author: Dalai Felinto
Date: Fri Dec 1 16:08:45 2017 -0200
Branches: blender2.8
https://developer.blender.org/rBaa0c9867b27cca4cff7d7083cda345928160044c
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.
===================================================================
M tests/python/view_layer/test_evaluation_selectability_a.py
M tests/python/view_layer/test_evaluation_selectability_b.py
M tests/python/view_layer/test_evaluation_selectability_c.py
M tests/python/view_layer/test_evaluation_selectability_d.py
M tests/python/view_layer/test_evaluation_selectability_e.py
M tests/python/view_layer/test_evaluation_visibility_a.py
M tests/python/view_layer/test_evaluation_visibility_b.py
M tests/python/view_layer/test_evaluation_visibility_c.py
M tests/python/view_layer/test_evaluation_visibility_d.py
M tests/python/view_layer/test_evaluation_visibility_e.py
M tests/python/view_layer/test_evaluation_visibility_f.py
M tests/python/view_layer/test_object_copy.py
M tests/python/view_layer/test_object_link_b.py
M tests/python/view_layer/test_operator_context.py
M tests/python/view_layer/view_layer_common.py
===================================================================
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.un
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list