-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mainline' into dependabot/pip/openjd-adaptor-runtime-gt…
…e-0.8-and-lt-0.10
- Loading branch information
Showing
35 changed files
with
152 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ body: | |
Thank you for taking the time to fill out this bug report! | ||
⚠️ If the bug that you are reporting is a security-related issue or security vulnerability, | ||
then please do not create a report via this template. Instead please | ||
then please do not create a report via this template. Instead please | ||
notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) | ||
or directly via email to [AWS Security]([email protected]). | ||
|
@@ -54,9 +54,9 @@ body: | |
description: Please provide information on the environment and software versions that you are using to reproduce the bug. | ||
value: | | ||
At minimum: | ||
1. Operating system: (e.g. Windows Server 2022; Amazon Linux 2023; etc.) | ||
2. Version of Maya: | ||
3: Version of this package: | ||
1. Operating system (e.g. Windows Server 2022; Amazon Linux 2023; etc.) | ||
2. Version of Maya | ||
3. Version of this package | ||
4. If this is from a version installed by the Deadline Cloud Submitter installer, then what version of the submitter installer? | ||
Please share other details about your environment that you think might be relevant to reproducing the bug. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
test/deadline_submitter_for_maya/unit/scripts/aws_deadline/__init__.py
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
test/deadline_submitter_for_maya/unit/scripts/test_scene.py
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
77 changes: 77 additions & 0 deletions
77
test/unit/deadline_submitter_for_maya/scripts/test_scene.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
from typing import Optional | ||
import pytest | ||
import os | ||
from unittest.mock import patch, Mock | ||
|
||
from deadline.maya_submitter.scene import FrameRange, Scene | ||
|
||
|
||
class TestFrameRange: | ||
frame_range_params = [(1, 100, 7), (1, 100, None), (1, None, 7), (10, 10, 10), (1, 10, 1)] | ||
|
||
@pytest.mark.parametrize("start, stop, step", frame_range_params) | ||
def test_frame_range_iter(self, start: int, stop: int, step: Optional[int]) -> None: | ||
# GIVEN | ||
frame_range = FrameRange(start, stop, step) | ||
|
||
# WHEN | ||
frames = [f for f in frame_range] | ||
|
||
# THEN | ||
if stop is None: | ||
stop = start | ||
if step is None: | ||
step = 1 | ||
assert frames == [i for i in range(start, stop + step, step)] | ||
|
||
@pytest.mark.parametrize("start, stop, step", frame_range_params) | ||
def test_frame_repr(self, start: int, stop: int, step: Optional[int]) -> None: | ||
# GIVEN | ||
frame_range = FrameRange(start, stop, step) | ||
|
||
# WHEN | ||
fr_repr = repr(frame_range) | ||
|
||
# THEN | ||
if stop is None or start == stop: | ||
assert fr_repr == str(start) | ||
elif step is None or step == 1: | ||
assert fr_repr == f"{start}-{stop}" | ||
else: | ||
assert fr_repr == f"{start}-{stop}:{step}" | ||
|
||
|
||
class TestScene: | ||
|
||
@patch("deadline.maya_submitter.scene.maya.cmds") | ||
def test_project_path(self, mock_maya_cmds: Mock) -> None: | ||
Scene.project_path() | ||
|
||
mock_maya_cmds.workspace.assert_called_once_with(query=True, rootDirectory=True) | ||
|
||
@patch.object(Scene, "project_path") | ||
@patch("deadline.maya_submitter.scene.maya") | ||
def test_output_path_with_images_suffix(self, mock_maya: Mock, mock_project_path: Mock) -> None: | ||
test_images_dir: str = "test_images_dir" | ||
test_project_path: str = "test_project_path" | ||
mock_maya.mel.eval.return_value = test_images_dir | ||
mock_project_path.return_value = test_project_path | ||
|
||
output_path: str = Scene.output_path() | ||
|
||
assert output_path == os.path.join(test_project_path, test_images_dir) | ||
|
||
@patch.object(Scene, "project_path") | ||
@patch("deadline.maya_submitter.scene.maya") | ||
def test_output_path_without_images_suffix( | ||
self, mock_maya: Mock, mock_project_path: Mock | ||
) -> None: | ||
test_project_path: str = "test_project_path" | ||
mock_maya.mel.eval.return_value = None | ||
mock_project_path.return_value = test_project_path | ||
|
||
output_path: str = Scene.output_path() | ||
|
||
assert output_path == test_project_path |
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
test/unit/deadline_submitter_for_maya/test_mel_commands.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
from deadline.maya_submitter.mel_commands import DeadlineCloudSubmitterCmd | ||
from unittest.mock import patch, Mock | ||
import maya.api.OpenMaya as om # pylint: disable=import-error | ||
from qtpy.QtCore import Qt # type: ignore | ||
from qtpy.QtWidgets import ( # type: ignore | ||
QApplication, | ||
) | ||
|
||
|
||
@patch("deadline.maya_submitter.mel_commands.show_maya_render_submitter") | ||
@patch.object(QApplication, "instance") | ||
@patch.object(om.MGlobal, "mayaState") | ||
def test_deadline_cloud_submitter_cmd_sticky_setting_load_only_once( | ||
mock_maya_state: Mock, mock_q_app: Mock, mock_show_maya_render_submitter: Mock | ||
) -> None: | ||
mock_maya_state.return_value = om.MGlobal.kInteractive | ||
maya_widget: Mock = Mock() | ||
maya_widget.objectName.return_value = "MayaWindow" | ||
q_app_instance: Mock = Mock() | ||
q_app_instance.topLevelWidgets.return_value = [maya_widget] | ||
mock_q_app.return_value = q_app_instance | ||
submitter_dialog: Mock = Mock() | ||
mock_show_maya_render_submitter.return_value = submitter_dialog | ||
|
||
DeadlineCloudSubmitterCmd.doIt(Mock()) | ||
|
||
mock_show_maya_render_submitter.assert_called_once_with( | ||
parent=maya_widget, f=Qt.Tool, load_sticky_setting=True | ||
) | ||
|
||
DeadlineCloudSubmitterCmd.doIt(Mock()) | ||
|
||
mock_show_maya_render_submitter.assert_called_with( | ||
parent=maya_widget, f=Qt.Tool, load_sticky_setting=False | ||
) | ||
submitter_dialog.close.assert_called_once() |