Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-02-23 14:35:14 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-02-24 12:10:24 +0300
commit2f9a0dfe6429661f1d4bdf28398504df7fe98beb (patch)
treeb95bf074a6b3f6246b99ebda3a663ed435dda150 /tests/python/render_layer/test_object_add_no_collection_empty.py
parent8261a84ffbe6d6a88389f374656135cef53e5b15 (diff)
Fix T50714: Collections: Adding object to scene without an existing collection
This was causing blender to segfault. We now add create a new collection and link to the layer before adding the new object (also included unittests, and requires updated lib/tests)
Diffstat (limited to 'tests/python/render_layer/test_object_add_no_collection_empty.py')
-rw-r--r--tests/python/render_layer/test_object_add_no_collection_empty.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/python/render_layer/test_object_add_no_collection_empty.py b/tests/python/render_layer/test_object_add_no_collection_empty.py
new file mode 100644
index 00000000000..49600f2e73e
--- /dev/null
+++ b/tests/python/render_layer/test_object_add_no_collection_empty.py
@@ -0,0 +1,39 @@
+# ./blender.bin --background -noaudio --python tests/python/render_layer/test_scene_copy.py -- --testdir="/data/lib/tests/"
+
+# ############################################################
+# Importing - Same For All Render Layer Tests
+# ############################################################
+
+import unittest
+
+import os, sys
+sys.path.append(os.path.dirname(__file__))
+
+from render_layer_common import *
+
+
+# ############################################################
+# Testing
+# ############################################################
+
+class UnitTesting(RenderLayerTesting):
+ def test_syncing_object_add_empty(self):
+ """
+ See if new objects are added to the correct collection
+ bpy.ops.object.add()
+ """
+ self.do_object_add_no_collection('EMPTY')
+
+
+# ############################################################
+# Main - Same For All Render Layer Tests
+# ############################################################
+
+if __name__ == '__main__':
+ import sys
+
+ extra_arguments = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []
+ sys.argv = [__file__] + (sys.argv[sys.argv.index("--") + 2:] if "--" in sys.argv else [])
+
+ UnitTesting._extra_arguments = extra_arguments
+ unittest.main()