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