def testDescribe(self): class Request1(messages.Message): pass class Response1(messages.Message): pass class Request2(messages.Message): pass class Response2(messages.Message): pass class MyService(remote.Service): @remote.method(Request1, Response1) def method1(self, request): pass @remote.method(Request2, Response2) def method2(self, request): pass expected = descriptor.ServiceDescriptor() expected.name = 'MyService' expected.methods = [] expected.methods.append(descriptor.describe_method(MyService.method1)) expected.methods.append(descriptor.describe_method(MyService.method2)) described = descriptor.describe_service(MyService) described.check_initialized() self.assertEquals(expected, described)
def testFindWithAbsoluteName(self): self.assertEquals( descriptor.describe_service(registry.RegistryService), descriptor.import_descriptor_loader('.protorpc.registry.RegistryService'))
def testService(self): class Service(remote.Service): pass self.assertEquals(descriptor.describe_service(Service), descriptor.describe(Service))
def testFindWithAbsoluteName(self): self.assertEquals( descriptor.describe_service(registry.RegistryService), descriptor.import_descriptor_loader( '.protorpc.registry.RegistryService'))
def testFindService(self): self.assertEquals( descriptor.describe_service(registry.RegistryService), descriptor.import_descriptor_loader("protorpc.registry.RegistryService"), )