def reparentGroups(self, groups): """Moves the given groups into this group @type groups: list<Group> @param groups: The groups to move into""" groupSeq = job_pb2.GroupSeq(groups=groups) self.stub.ReparentGroups(job_pb2.GroupReparentGroupsRequest( group=self.data, groups=groupSeq), timeout=Cuebot.Timeout)
def reparentGroups(self, groups): """Moves the given groups into this group. :type groups: list<opencue.wrappers.group.Group> :param groups: The groups to move into""" groupSeq = job_pb2.GroupSeq(groups=[group.data for group in groups]) self.stub.ReparentGroups(job_pb2.GroupReparentGroupsRequest( group=self.data, groups=groupSeq), timeout=Cuebot.Timeout)
def testReparentGroups(self, getStubMock): stubMock = mock.Mock() stubMock.ReparentGroups.return_value = job_pb2.GroupReparentGroupsResponse() getStubMock.return_value = stubMock groups = [opencue.wrappers.group.Group(job_pb2.Group())] groupSeq = job_pb2.GroupSeq(groups=[grp.data for grp in groups]) group = opencue.wrappers.group.Group( job_pb2.Group(name=TEST_GROUP_NAME)) group.reparentGroups(groups) stubMock.ReparentGroups.assert_called_with( job_pb2.GroupReparentGroupsRequest(group=group.data, groups=groupSeq), timeout=mock.ANY)