示例#1
0
文件: deed.py 项目: vibss2397/OpenCue
    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)
示例#2
0
    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)