ComponentUpdateListProperty_test.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. """
  2. All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
  3. its licensors.
  4. For complete copyright and license terms please see the LICENSE at the root of this
  5. distribution (the "License"). All use of this software is governed by the License,
  6. or, if provided, by the license below or the license accompanying this file. Do not
  7. remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. """
  10. import os
  11. import pytest
  12. import logging
  13. # Bail on the test if ly_test_tools doesn't exist.
  14. pytest.importorskip("ly_test_tools")
  15. import ly_test_tools.environment.file_system as file_system
  16. import automatedtesting_shared.hydra_test_utils as hydra
  17. logger = logging.getLogger(__name__)
  18. test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
  19. @pytest.mark.SUITE_sandbox
  20. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  21. @pytest.mark.parametrize("level", ["tmp_level"])
  22. @pytest.mark.usefixtures("automatic_process_killer")
  23. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  24. class TestComponentAssetListAutomation(object):
  25. @pytest.fixture(autouse=True)
  26. def setup_teardown(self, request, workspace, project, level):
  27. # Cleanup our temp level
  28. file_system.delete([os.path.join(workspace.paths.dev(), project, "Levels", level)], True, True)
  29. def teardown():
  30. # Cleanup our temp level
  31. file_system.delete([os.path.join(workspace.paths.dev(), project, "Levels", level)], True, True)
  32. request.addfinalizer(teardown)
  33. def test_ComponentAssetList(self, request, editor, level, launcher_platform):
  34. expected_lines = [
  35. 'Set EditorDescriptorListComponent Embedded Assets as List',
  36. 'Set EditorDescriptorListComponent Embedded Assets 0 Descriptor Mesh Asset ID',
  37. 'Set EditorDescriptorListComponent Embedded Assets 1 Descriptor Mesh Asset ID',
  38. 'Set EditorDescriptorListComponent Embedded Assets 2 Descriptor Mesh Asset ID',
  39. 'Set EditorDescriptorListComponent Embedded Assets 3 Descriptor Mesh Asset ID'
  40. ]
  41. hydra.launch_and_validate_results(
  42. request,
  43. test_directory,
  44. editor,
  45. "ComponentUpdateListProperty_test_case.py",
  46. expected_lines=expected_lines,
  47. cfg_args=[level]
  48. )