Exemplo n.º 1
0
def getDefaultServices():
    """
    Return the default service list.  Services
    define the default application features.
    @rtype list<Service>
    """
    response = Cuebot.getStub('service').GetDefaultServices(
        service_pb2.ServiceGetDefaultServicesRequest(), timeout=Cuebot.Timeout)
    return response.services.services
Exemplo n.º 2
0
    def testGetDefault(self, stubMock):
        service1 = 'service1'
        service2 = 'service2'
        stubMock.GetDefaultServices.return_value = service_pb2.ServiceGetDefaultServicesResponse(
            services=service_pb2.ServiceSeq(
                services=[service_pb2.Service(name=service1), service_pb2.Service(name=service2)]))

        services = opencue.api.getDefaultServices()

        stubMock.GetDefaultServices.assert_called_with(
            service_pb2.ServiceGetDefaultServicesRequest(), timeout=mock.ANY)
        self.assertEqual([service1, service2], [service.name() for service in services])
Exemplo n.º 3
0
    def testGetDefaultServices(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.GetDefaultServices.return_value = service_pb2.ServiceGetDefaultServicesResponse(
            services=service_pb2.ServiceSeq(
                services=[service_pb2.Service(name=TEST_SERVICE_NAME)]))
        getStubMock.return_value = stubMock

        wrapper = opencue.wrappers.service.Service()
        services = wrapper.getDefaultServices()

        stubMock.GetDefaultServices.assert_called_with(
            service_pb2.ServiceGetDefaultServicesRequest(), timeout=mock.ANY)
        self.assertEqual(len(services), 1)
        self.assertEqual(services[0].name(), TEST_SERVICE_NAME)
Exemplo n.º 4
0
 def getDefaultServices():
     """Returns the default services."""
     response = Cuebot.getStub('service').GetDefaultServices(
         service_pb2.ServiceGetDefaultServicesRequest(),
         timeout=Cuebot.Timeout)
     return [Service(data) for data in response.services.services]
Exemplo n.º 5
0
 def getDefaultServices(cls):
     response = cls.stub.GetDefaultServices(
         service_pb2.ServiceGetDefaultServicesRequest(),
         timeout=Cuebot.Timeout)
     return [Service(data) for data in response.services.services]