0

I have one function for calling attribute service call. Now I want to write pytest for that using monkey patch. How to write test code for this monkey patch was called?

def attr_service_call(attr_url):
    PARAMS = {'username':'username', 'password':'password'}
    resp = requests.get(attr_url, params=PARAMS, timeout= 30)
    resp_json = resp.json()
    resturn resp_json

How to write pytest for above code and and attr service call was called using monkey patching. Help me to write pytest for this. Thanks

Kumar
  • 161
  • 1
  • 2
  • 12

0 Answers0