Example #1
0
    def testSetDefaultMaxCores(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.SetDefaultMaxCores.return_value = show_pb2.ShowSetDefaultMaxCoresResponse()
        getStubMock.return_value = stubMock

        show = opencue.wrappers.show.Show(show_pb2.Show(name=TEST_SHOW_NAME))
        show.setDefaultMaxCores(TEST_MAX_CORES)

        stubMock.SetDefaultMaxCores.assert_called_with(
            show_pb2.ShowSetDefaultMaxCoresRequest(show=show.data, max_cores=TEST_MAX_CORES),
            timeout=mock.ANY)
Example #2
0
 def setDefaultMaxCores(self, maxcores):
     """Sets the default maximum number of cores
     that new jobs are launched with.
     @type: float
     @param: value to set maxCores to
     @rtype: show_pb2.ShowSetDefaultMaxCoresResponse
     @return: response is empty
     """
     response = self.stub.SetDefaultMaxCores(show_pb2.ShowSetDefaultMaxCoresRequest(
         show=self.data, max_cores=maxcores),
         timeout=Cuebot.Timeout)
     return response
Example #3
0
    def setDefaultMaxCores(self, maxcores):
        """Sets the default maximum number of cores that new jobs are launched with.

        :type  maxcores: float
        :param maxcores: new maximum number of cores for new jobs
        :rtype:  show_pb2.ShowSetDefaultMaxCoresResponse
        :return: response is empty
        """
        response = self.stub.SetDefaultMaxCores(show_pb2.ShowSetDefaultMaxCoresRequest(
            show=self.data, max_cores=maxcores),
            timeout=Cuebot.Timeout)
        return response