コード例 #1
0
    def testAddLimit(self, getStubMock):
        test_limit_id = 'lll-llll-lll'
        stubMock = mock.Mock()
        stubMock.AddLimit.return_value = job_pb2.LayerAddLimitResponse()
        getStubMock.return_value = stubMock

        layer = opencue.wrappers.layer.Layer(
            job_pb2.Layer(name=TEST_LAYER_NAME))
        layer.addLimit(test_limit_id)

        stubMock.AddLimit.assert_called_with(job_pb2.LayerAddLimitRequest(
            layer=layer.data, limit_id=test_limit_id),
                                             timeout=mock.ANY)
コード例 #2
0
 def addLimit(self, limit_id):
     """Add a limit to the current layer."""
     return self.stub.AddLimit(job_pb2.LayerAddLimitRequest(
         layer=self.data, limit_id=limit_id),
                               timeout=Cuebot.Timeout)