test_move_into_layer_collection_h.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # ############################################################
  2. # Importing - Same For All Render Layer Tests
  3. # ############################################################
  4. import unittest
  5. import os
  6. import sys
  7. from view_layer_common import *
  8. # ############################################################
  9. # Testing
  10. # ############################################################
  11. class UnitTesting(MoveLayerCollectionTesting):
  12. def get_reference_scene_tree_map(self):
  13. reference_tree_map = [
  14. ['A', [
  15. ['i', None],
  16. ['ii', None],
  17. ['iii', None],
  18. ]],
  19. ['B', None],
  20. ['C', [
  21. ['1', [
  22. ['dog', None],
  23. ]],
  24. ['2', None],
  25. ['3', [
  26. ['cat', None],
  27. ]],
  28. ]],
  29. ]
  30. return reference_tree_map
  31. def get_reference_layers_tree_map(self):
  32. # original tree, no changes
  33. return self.get_initial_layers_tree_map()
  34. def test_layer_collection_into_a(self):
  35. """
  36. Test outliner operations
  37. """
  38. self.setup_tree()
  39. self.assertTrue(self.move_into('Layer 1.3.dog', 'Layer 1.C.1'))
  40. self.compare_tree_maps()
  41. def test_layer_collection_into_b(self):
  42. """
  43. Test outliner operations
  44. """
  45. self.setup_tree()
  46. # collection that will be moved
  47. collection_original = self.parse_move('Layer 1.3.dog')
  48. collection_original.enabled = True
  49. collection_original.selectable = False
  50. self.assertTrue(self.move_into('Layer 1.3.dog', 'Layer 1.C.1'))
  51. self.compare_tree_maps()
  52. # we expect the settings to be carried along from the
  53. # original layer collection
  54. collection_new = self.parse_move('Layer 1.C.1.dog')
  55. self.assertEqual(collection_new.enabled, True)
  56. self.assertEqual(collection_new.selectable, False)
  57. # ############################################################
  58. # Main - Same For All Render Layer Tests
  59. # ############################################################
  60. if __name__ == '__main__':
  61. UnitTesting._extra_arguments = setup_extra_arguments(__file__)
  62. unittest.main()