Merge branch 'master' into blender2.8
[blender.git] / tests / python / render_layer / test_move_above_below_scene_collection_sync_a.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(MoveSceneCollectionSyncTesting):
17     def get_reference_scene_tree_map(self):
18         # original tree, no changes
19         reference_tree_map = [
20                 ['A', [
21                     ['i', None],
22                     ['ii', None],
23                     ['iii', None],
24                     ]],
25                 ['B', None],
26                 ['C', [
27                     ['1', None],
28                     ['2', None],
29                     ['3', [
30                         ['dog', None],
31                         ['cat', None],
32                         ]],
33                     ]],
34                 ]
35         return reference_tree_map
36
37     def test_scene_collection_move_a(self):
38         """
39         Test outliner operations
40         """
41         tree = self.setup_tree()
42         self.assertTrue(tree['cat'].move_above(tree['dog']))
43         self.assertTrue(tree['dog'].move_above(tree['cat']))
44         self.compare_tree_maps()
45
46     def test_scene_collection_move_b(self):
47         """
48         Test outliner operations
49         """
50         tree = self.setup_tree()
51         self.assertTrue(tree['dog'].move_below(tree['cat']))
52         self.assertTrue(tree['cat'].move_below(tree['dog']))
53         self.compare_tree_maps()
54
55     def test_scene_collection_move_c(self):
56         """
57         Test outliner operations
58         """
59         tree = self.setup_tree()
60         self.assertTrue(tree['dog'].move_below(tree['cat']))
61         self.assertTrue(tree['dog'].move_above(tree['cat']))
62         self.compare_tree_maps()
63
64     def test_scene_collection_move_d(self):
65         """
66         Test outliner operations
67         """
68         tree = self.setup_tree()
69         self.assertTrue(tree['cat'].move_above(tree['dog']))
70         self.assertTrue(tree['cat'].move_below(tree['dog']))
71         self.compare_tree_maps()
72
73
74 # ############################################################
75 # Main - Same For All Render Layer Tests
76 # ############################################################
77
78 if __name__ == '__main__':
79     UnitTesting._extra_arguments = setup_extra_arguments(__file__)
80     unittest.main()