Skip to content

Commit

Permalink
Cuegui dropDepends unittest uses depends
Browse files Browse the repository at this point in the history
The changes to dropDepends broke the MenuActions
unittest, because the fn now calls
`getWhatThisDependsOn`, which threw a `'Mock' object
is not iterable` error. Needed to add depend object
for it to pass.
  • Loading branch information
roulaoregan-spi committed May 19, 2021
1 parent 1bed2ee commit 55761fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cuegui/tests/MenuActions_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,12 +947,13 @@ def test_markAsWaiting(self, yesNoMock):
def test_dropDepends(self, yesNoMock, frameSearchMock):
frame_name = 'arbitrary-frame-name'
frame = opencue.wrappers.frame.Frame(opencue.compiled_proto.job_pb2.Frame(name=frame_name))
depend = opencue.wrappers.depend.Depend(opencue.compiled_proto.depend_pb2.Depend())

frame.getWhatThisDependsOn = lambda: [depend]
frame.dropDepends = mock.Mock()

self.frame_actions.dropDepends(rpcObjects=[frame])

frame.dropDepends.assert_called_with(opencue.api.depend_pb2.ANY_TARGET)

@mock.patch('cuegui.DependWizard.DependWizard')
def test_dependWizard(self, dependWizardMock):
frames = [opencue.wrappers.frame.Frame()]
Expand Down

0 comments on commit 55761fb

Please sign in to comment.