def testUndescribable(self): class NonService(object): def fn(self): pass for value in (NonService, NonService.fn, 1, 'string', 1.2, None): self.assertEquals(None, descriptor.describe(value))
def testUndescribable(self): class NonService(object): def fn(self): pass for value in (NonService, NonService.fn, 1, "string", 1.2, None): self.assertEquals(None, descriptor.describe(value))
def testMethod(self): class Param(messages.Message): pass class Service(remote.Service): @remote.method(Param, Param) def fn(self): return Param() self.assertEquals(descriptor.describe_method(Service.fn), descriptor.describe(Service.fn))
def testService(self): class Service(remote.Service): pass self.assertEquals(descriptor.describe_service(Service), descriptor.describe(Service))
def testEnum(self): self.assertEquals( descriptor.describe_enum(test_util.OptionalMessage.SimpleEnum), descriptor.describe(test_util.OptionalMessage.SimpleEnum))
def testMessage(self): self.assertEquals(descriptor.describe_message(test_util.NestedMessage), descriptor.describe(test_util.NestedMessage))
def testEnumValue(self): self.assertEquals( descriptor.describe_enum_value( test_util.OptionalMessage.SimpleEnum.VAL1), descriptor.describe(test_util.OptionalMessage.SimpleEnum.VAL1))
def testField(self): self.assertEquals( descriptor.describe_field(test_util.NestedMessage.a_value), descriptor.describe(test_util.NestedMessage.a_value))
def testModule(self): self.assertEquals(descriptor.describe_file(test_util), descriptor.describe(test_util))