def setBlackoutTime(self, startTime, stopTime): """Sets a blackout time for the host. :type startTime: int :param startTime: blackout start time :type stopTime: int :param stopTime: blackout stop time""" self.stub.SetBlackoutTime(host_pb2.DeedSetBlackoutTimeRequest( deed=self.data, start_time=startTime, stop_time=stopTime), timeout=Cuebot.Timeout)
def testSetBlackoutTime(self, getStubMock): stubMock = mock.Mock() stubMock.SetBlackoutTime.return_value = host_pb2.DeedSetBlackoutTimeResponse() getStubMock.return_value = stubMock testStartTime = 100 testStopTime = 200 deed = opencue.wrappers.deed.Deed(host_pb2.Deed(id=TEST_DEED_ID)) deed.setBlackoutTime(testStartTime, testStopTime) stubMock.SetBlackoutTime.assert_called_with( host_pb2.DeedSetBlackoutTimeRequest(deed=deed.data, start_time=testStartTime, stop_time=testStopTime), timeout=mock.ANY)