2
0

EditorCommandLine_test.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. """
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. """
  6. #
  7. # This is a pytest module to test the in-Editor Python API from PythonEditorFuncs
  8. #
  9. import pytest
  10. pytest.importorskip('ly_test_tools')
  11. import sys
  12. import os
  13. sys.path.append(os.path.dirname(__file__))
  14. from hydra_utils import launch_test_case, launch_test_case_with_args
  15. @pytest.mark.SUITE_sandbox
  16. @pytest.mark.parametrize('launcher_platform', ['windows_editor'])
  17. @pytest.mark.parametrize('project', ['AutomatedTesting'])
  18. @pytest.mark.parametrize('level', ['Simple'])
  19. class TestEditorAutomation(object):
  20. def test_EditorNoArgs(self, request, editor, level, launcher_platform):
  21. unexpected_lines=[]
  22. expected_lines = [
  23. "editor command line works",
  24. ]
  25. test_case_file = os.path.join(os.path.dirname(__file__), 'EditorCommandLine_test_case.py')
  26. launch_test_case(editor, test_case_file, expected_lines, unexpected_lines)
  27. def test_EditorWithArgs(self, request, editor, level, launcher_platform):
  28. unexpected_lines=[]
  29. expected_lines = [
  30. "editor command line works",
  31. "editor command line arg foo",
  32. "editor command line arg bar",
  33. "editor command line arg baz",
  34. "editor engroot set",
  35. "path resolved worked"
  36. ]
  37. extra_args = ['foo bar baz']
  38. test_case_file = os.path.join(os.path.dirname(__file__), 'EditorCommandLine_test_case.py')
  39. launch_test_case_with_args(editor, test_case_file, expected_lines, unexpected_lines, extra_args)