Unittest: split object_add in individual test files

(and small cleanup in unittest)

This is required to the upcoming unittest + bugfix
This commit is contained in:
Dalai Felinto
2017-02-23 12:26:48 +01:00
parent 4c8d8da2e7
commit 8261a84ffb
6 changed files with 207 additions and 138 deletions

View File

@@ -0,0 +1,42 @@
# ./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()
"""
import os
ROOT = self.get_root()
filepath_json = os.path.join(ROOT, 'layers_object_add_empty.json')
self.do_object_add(filepath_json, '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()