diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-02-23 14:35:14 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-02-24 12:10:24 +0300 |
commit | 2f9a0dfe6429661f1d4bdf28398504df7fe98beb (patch) | |
tree | b95bf074a6b3f6246b99ebda3a663ed435dda150 /tests/python/render_layer/test_object_add_no_collection_torus.py | |
parent | 8261a84ffbe6d6a88389f374656135cef53e5b15 (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_torus.py')
-rw-r--r-- | tests/python/render_layer/test_object_add_no_collection_torus.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/python/render_layer/test_object_add_no_collection_torus.py b/tests/python/render_layer/test_object_add_no_collection_torus.py new file mode 100644 index 00000000000..11358d680a1 --- /dev/null +++ b/tests/python/render_layer/test_object_add_no_collection_torus.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_torus(self): + """ + See if new objects are added to the correct collection + bpy.ops.mesh.primitive_torus_add() + """ + self.do_object_add_no_collection('TORUS') + + +# ############################################################ +# 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() |