Merge branch 'master' into blender2.8
[blender.git] / tests / python / render_layer / test_move_above_below_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                     ]],
24                 ['B', None],
25                 ['C', [
26                     ['1', None],
27                     ['3', [
28                         ['dog', None],
29                         ['cat', None],
30                         ]],
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                     '3',
42                     ]],
43                 ['Layer 2', [
44                     'C',
45                     'dog',
46                     'cat',
47                     ]],
48                 ]
49         return reference_layers_map
50
51     def test_layer_collection_move_a(self):
52         """
53         Test outliner operations
54         """
55         self.setup_tree()
56         self.assertTrue(self.move_below('Layer 2.3', 'Layer 2.C.1'))
57         self.compare_tree_maps()
58
59     def test_layer_collection_move_b(self):
60         """
61         Test outliner operations
62         """
63         self.setup_tree()
64         self.assertTrue(self.move_above('Layer 2.3', 'Layer 2.C.2'))
65         self.compare_tree_maps()
66
67     def test_layer_collection_move_c(self):
68         """
69         Test outliner operations
70         """
71         self.setup_tree()
72
73         # collection that will be moved
74         collection_original = self.parse_move('Layer 2.3')
75         collection_original.hide = False
76         collection_original.hide_select = True
77
78         # collection that will disappear
79         collection_old = self.parse_move('Layer 2.C.3')
80         collection_old.hide = True
81         collection_old.hide_select = False
82
83         # move
84         self.assertTrue(self.move_below('Layer 2.3', 'Layer 2.C.1'))
85         self.compare_tree_maps()
86
87         # we expect the settings to be carried along from the
88         # original layer collection
89         collection_new = self.parse_move('Layer 2.C.3')
90         self.assertEqual(collection_new.hide, False)
91         self.assertEqual(collection_new.hide_select, True)
92
93
94 # ############################################################
95 # Main - Same For All Render Layer Tests
96 # ############################################################
97
98 if __name__ == '__main__':
99     UnitTesting._extra_arguments = setup_extra_arguments(__file__)
100     unittest.main()