test_move_into_layer_collection_f.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. ['3', [
  19. ['dog', None],
  20. ['cat', None],
  21. ]],
  22. ]],
  23. ['B', None],
  24. ['C', [
  25. ['1', None],
  26. ['2', None],
  27. ]],
  28. ]
  29. return reference_tree_map
  30. def get_reference_layers_tree_map(self):
  31. reference_layers_map = [
  32. ['Layer 1', [
  33. 'Master Collection',
  34. 'C',
  35. ]],
  36. ['Layer 2', [
  37. 'C',
  38. '3',
  39. 'dog',
  40. 'cat',
  41. ]],
  42. ]
  43. return reference_layers_map
  44. def test_layer_collection_into_a(self):
  45. """
  46. Test outliner operations
  47. """
  48. self.setup_tree()
  49. self.assertTrue(self.move_into("Layer 1.3", "Layer 1.Master Collection.A"))
  50. self.compare_tree_maps()
  51. def test_layer_collection_into_b(self):
  52. """
  53. Test outliner operations
  54. """
  55. self.setup_tree()
  56. # collection that will be moved
  57. collection_original = self.parse_move('Layer 1.3')
  58. collection_original.enabled = True
  59. collection_original.selectable = False
  60. self.assertTrue(self.move_into('Layer 1.3', 'Layer 1.Master Collection.A'))
  61. self.compare_tree_maps()
  62. # we expect the settings to be carried along from the
  63. # original layer collection
  64. collection_new = self.parse_move('Layer 1.Master Collection.A.3')
  65. self.assertEqual(collection_new.enabled, True)
  66. self.assertEqual(collection_new.selectable, False)
  67. # ############################################################
  68. # Main - Same For All Render Layer Tests
  69. # ############################################################
  70. if __name__ == '__main__':
  71. UnitTesting._extra_arguments = setup_extra_arguments(__file__)
  72. unittest.main()