[Bf-blender-cvs] [2e3f662473f] temp-group-collections: Unittesting (failing) for read/write

Dalai Felinto noreply at git.blender.org
Wed Nov 1 18:15:08 CET 2017


Commit: 2e3f662473f5882f580c46f15c49076ff89665fc
Author: Dalai Felinto
Date:   Wed Nov 1 10:26:14 2017 -0200
Branches: temp-group-collections
https://developer.blender.org/rB2e3f662473f5882f580c46f15c49076ff89665fc

Unittesting (failing) for read/write

===================================================================

M	tests/python/render_layer/CMakeLists.txt
A	tests/python/render_layer/test_group_d.py

===================================================================

diff --git a/tests/python/render_layer/CMakeLists.txt b/tests/python/render_layer/CMakeLists.txt
index 0f4d373f720..29634531eb0 100644
--- a/tests/python/render_layer/CMakeLists.txt
+++ b/tests/python/render_layer/CMakeLists.txt
@@ -89,6 +89,7 @@ RENDER_LAYER_TEST(evaluation_selectability_f)
 RENDER_LAYER_TEST(group_a)
 RENDER_LAYER_TEST(group_b)
 RENDER_LAYER_TEST(group_c)
+RENDER_LAYER_TEST(group_d)
 RENDER_LAYER_TEST(object_add_cylinder)
 RENDER_LAYER_TEST(object_add_empty)
 RENDER_LAYER_TEST(object_add_torus)
diff --git a/tests/python/render_layer/test_group_d.py b/tests/python/render_layer/test_group_d.py
new file mode 100644
index 00000000000..1600eef8129
--- /dev/null
+++ b/tests/python/render_layer/test_group_d.py
@@ -0,0 +1,52 @@
+# ############################################################
+# Importing - Same For All Render Layer Tests
+# ############################################################
+
+import unittest
+import os
+import sys
+
+from render_layer_common import *
+
+
+# ############################################################
+# Testing
+# ############################################################
+
+class UnitTesting(RenderLayerTesting):
+    def test_group_write_load(self):
+        """
+        See if saving/loading is working for groups
+        """
+        import bpy
+        scene = bpy.context.scene
+        layer_collection = bpy.context.layer_collection
+
+        while len(scene.render_layers) > 1:
+            scene.render_layers.remove(scene.render_layers[1])
+
+        # create group
+        group = layer_collection.create_group()
+
+        # update depsgraph
+        scene.update()
+
+        import os
+        import tempfile
+        with tempfile.TemporaryDirectory() as dirpath:
+            filepath = os.path.join(dirpath, 'layers.blend')
+
+            # save file
+            bpy.ops.wm.save_mainfile('EXEC_DEFAULT', filepath=filepath)
+
+            # open file
+            bpy.ops.wm.open_mainfile('EXEC_DEFAULT', filepath=filepath)
+
+
+# ############################################################
+# Main - Same For All Render Layer Tests
+# ############################################################
+
+if __name__ == '__main__':
+    UnitTesting._extra_arguments = setup_extra_arguments(__file__)
+    unittest.main()



More information about the Bf-blender-cvs mailing list