Merge branch 'master' into blender2.8
[blender.git] / tests / python / render_layer / test_move_into_layer_collection_f.py
1 # ############################################################
2 # Importing - Same For All Render Layer Tests
3 # ############################################################
4
5 import unittest
6 import os
7 import sys
8
9 from render_layer_common import *
10
11
12 # ############################################################
13 # Testing
14 # ############################################################
15
16 class UnitTesting(MoveLayerCollectionTesting):
17     def get_reference_scene_tree_map(self):
18         reference_tree_map = [
19                 ['A', [
20                     ['i', None],
21                     ['ii', None],
22                     ['iii', None],
23                     ['3', [
24                         ['dog', None],
25                         ['cat', None],
26                         ]],
27                     ]],
28                 ['B', None],
29                 ['C', [
30                     ['1', None],
31                     ['2', None],
32                     ]],
33                 ]
34         return reference_tree_map
35
36     def get_reference_layers_tree_map(self):
37         reference_layers_map = [
38                 ['Layer 1', [
39                     'Master Collection',
40                     'C',
41                     ]],
42                 ['Layer 2', [
43                     'C',
44                     '3',
45                     'dog',
46                     'cat',
47                     ]],
48                 ]
49         return reference_layers_map
50
51     def test_layer_collection_into_a(self):
52         """
53         Test outliner operations
54         """
55         self.setup_tree()
56         self.assertTrue(self.move_into("Layer 1.3", "Layer 1.Master Collection.A"))
57         self.compare_tree_maps()
58
59     def test_layer_collection_into_b(self):
60         """
61         Test outliner operations
62         """
63         self.setup_tree()
64
65         # collection that will be moved
66         collection_original = self.parse_move('Layer 1.3')
67         collection_original.hide = False
68         collection_original.hide_select = True
69
70         self.assertTrue(self.move_into('Layer 1.3', 'Layer 1.Master Collection.A'))
71         self.compare_tree_maps()
72
73         # we expect the settings to be carried along from the
74         # original layer collection
75         collection_new = self.parse_move('Layer 1.Master Collection.A.3')
76         self.assertEqual(collection_new.hide, False)
77         self.assertEqual(collection_new.hide_select, True)
78
79
80 # ############################################################
81 # Main - Same For All Render Layer Tests
82 # ############################################################
83
84 if __name__ == '__main__':
85     UnitTesting._extra_arguments = setup_extra_arguments(__file__)
86     unittest.main()