Merge branch 'master' into blender2.8
[blender.git] / tests / python / render_layer / test_move_above_below_layer_collection_g.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                     ['2', None],
28                     ['3', [
29                         ['cat', None],
30                         ['dog', None],
31                         ]],
32                     ]],
33                 ]
34         return reference_tree_map
35
36     def get_reference_layers_tree_map(self):
37         # original tree, no changes
38         return self.get_initial_layers_tree_map()
39
40     def test_layer_collection_move_a(self):
41         """
42         Test outliner operations
43         """
44         self.setup_tree()
45         self.assertTrue(self.move_above('Layer 2.C.3.cat', 'Layer 2.3.dog'))
46         self.compare_tree_maps()
47
48     def test_layer_collection_move_b(self):
49         """
50         Test outliner operations
51         """
52         self.setup_tree()
53
54         # collection that will be moved
55         collection_original = self.parse_move('Layer 2.C.3.cat')
56         collection_original.hide = False
57         collection_original.hide_select = True
58
59         # collection that will disappear
60         collection_old = self.parse_move('Layer 2.3.cat')
61         collection_old.hide = True
62         collection_old.hide_select = False
63
64         # move
65         self.assertTrue(self.move_above('Layer 2.C.3.cat', 'Layer 2.3.dog'))
66         self.compare_tree_maps()
67
68         # we expect the settings to be carried along from the
69         # original layer collection
70         collection_new = self.parse_move('Layer 2.3.cat')
71         self.assertEqual(collection_new.hide, False)
72         self.assertEqual(collection_new.hide_select, True)
73
74
75 # ############################################################
76 # Main - Same For All Render Layer Tests
77 # ############################################################
78
79 if __name__ == '__main__':
80     UnitTesting._extra_arguments = setup_extra_arguments(__file__)
81     unittest.main()