Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame dropDepends now drops all depend types #976

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cuegui/cuegui/MenuActions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,8 +1016,12 @@ def dropDepends(self, rpcObjects=None):
"Drop dependencies on selected frames?\n"
"(Drops all of the frame's dependencies)",
names):
# Remove all dependency types
# - get what frame depends on and remove each one
for frame in frames:
frame.dropDepends(opencue.api.depend_pb2.ANY_TARGET)
dependencies = frame.getWhatThisDependsOn()
for d in dependencies:
d.satisfy()
self._update()

dependWizard_info = ["Dependency &Wizard...", None, "configure"]
Expand Down
11 changes: 0 additions & 11 deletions cuegui/tests/MenuActions_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,17 +942,6 @@ def test_markAsWaiting(self, yesNoMock):

self.job.markAsWaiting.assert_called_with(name=[frame_name])

@mock.patch('opencue.search.FrameSearch')
@mock.patch('cuegui.Utils.questionBoxYesNo', return_value=True)
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))
frame.dropDepends = mock.Mock()

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

frame.dropDepends.assert_called_with(opencue.api.depend_pb2.ANY_TARGET)
DiegoTavares marked this conversation as resolved.
Show resolved Hide resolved

@mock.patch('cuegui.DependWizard.DependWizard')
def test_dependWizard(self, dependWizardMock):
frames = [opencue.wrappers.frame.Frame()]
Expand Down
13 changes: 13 additions & 0 deletions pycue/tests/wrappers/frame_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ def testMarkAsWaiting(self, getStubMock):
stubMock.MarkAsWaiting.assert_called_with(
job_pb2.FrameMarkAsWaitingRequest(frame=frame.data), timeout=mock.ANY)

def testDropDepends(self, getStubMock):
stubMock = mock.Mock()
stubMock.DropDepends.return_value = job_pb2.FrameDropDependsResponse()
getStubMock.return_value = stubMock

target = depend_pb2.ANY_TARGET
frame = opencue.wrappers.frame.Frame(job_pb2.Frame(name='arbitrary-frame-name'))
frame.dropDepends(target)

stubMock.DropDepends.assert_called_with(
job_pb2.FrameDropDependsRequest(frame=frame.data, target=target),
timeout=mock.ANY)

def testRunTimeZero(self, getStubMock):
zeroFrame = opencue.wrappers.frame.Frame(
job_pb2.Frame(name=TEST_FRAME_NAME, start_time=0, stop_time=1000))
Expand Down