def setThreadMode(self, mode): """Set the thread mode to mode @type mode: ThreadMode @param mode: ThreadMode to set host to """ self.stub.SetThreadMode(host_pb2.HostSetThreadModeRequest(host=self.data, mode=mode), timeout=Cuebot.Timeout)
def testSetThreadMode(self, getStubMock): stubMock = mock.Mock() stubMock.SetThreadMode.return_value = host_pb2.HostSetThreadModeResponse( ) getStubMock.return_value = stubMock mode = host_pb2.VARIABLE host = opencue.wrappers.host.Host(host_pb2.Host(name=TEST_HOST_NAME)) host.setThreadMode(mode) stubMock.SetThreadMode.assert_called_with( host_pb2.HostSetThreadModeRequest(host=host.data, mode=mode), timeout=mock.ANY)