test_move_into_layer_collection_g.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. # original tree, no changes
  14. return self.get_initial_scene_tree_map()
  15. def get_reference_layers_tree_map(self):
  16. reference_layers_map = [
  17. ['Layer 1', [
  18. 'Master Collection',
  19. 'C',
  20. '3',
  21. ]],
  22. ['Layer 2', [
  23. 'C',
  24. 'dog',
  25. 'cat',
  26. ]],
  27. ]
  28. return reference_layers_map
  29. def test_layer_collection_into_a(self):
  30. """
  31. Test outliner operations
  32. """
  33. self.setup_tree()
  34. self.assertTrue(self.move_into('Layer 2.3', 'Layer 2.C'))
  35. self.compare_tree_maps()
  36. def test_layer_collection_into_b(self):
  37. """
  38. Test outliner operations
  39. """
  40. self.setup_tree()
  41. # collection that will be moved
  42. collection_original = self.parse_move('Layer 2.3')
  43. collection_original.enabled = True
  44. collection_original.selectable = False
  45. # collection that will disappear
  46. collection_old = self.parse_move('Layer 2.C.3')
  47. collection_old.enabled = False
  48. collection_old.selectable = True
  49. # move collection
  50. self.assertTrue(self.move_into('Layer 2.3', 'Layer 2.C'))
  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 2.C.3')
  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()