lundi 23 janvier 2017

Python: take a web-service method using reflection

Good day! I trying to go the method of web-service using reflection. Here is an example of code:

...

api = cf.SomeServiceAPI()

#Test1
def test_SomeMethod(self):
   result = self.sender('SomeMethod', [setofvalue])
   self.assertEqual(result, "Success", msg=result)

def sender(self, methodname, setofvalue):
   result = self.api.service.SomeMethod(setofvalue)
   return result

Please help me understand how to apply the method using method's name? Thanks!





Aucun commentaire:

Enregistrer un commentaire