Skip to content

Commit

Permalink
Mock function call in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Esteban Papp <[email protected]>
  • Loading branch information
amznestebanpapp committed Oct 11, 2023
1 parent a51edc8 commit 10895e6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/deadline_submitter_for_maya/unit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

import sys
from unittest.mock import MagicMock
from unittest.mock import MagicMock, Mock

# we must mock maya and UI code
mock_modules = [
Expand All @@ -25,6 +25,13 @@
for module in mock_modules:
sys.modules[module] = MagicMock()

# Mock the call to DeadlineCredentialsStatus.getInstance that happens at the module level
# in submit_job_to_deadline_dialog.py. That call is done at the module level to gather the
# status before the dialog is opened.
from deadline.client.ui.deadline_credentials_status import DeadlineCredentialsStatus

DeadlineCredentialsStatus.getInstance = Mock(return_value=None)


def configure_mocks():
"""Any extra mocking set up required"""
Expand Down

0 comments on commit 10895e6

Please sign in to comment.