def test_get_recent_blogs(self): api = PhishNetAPI() blogs_response = api.get_recent_blogs() assert blogs_response['error_code'] == 0 assert blogs_response['response']['count'] == len( blogs_response['response']['data'])
def test_get_recent_blogs(self, requests_mock): api = PhishNetAPI('apikey123456789test1') with open('tests/data/recent_blogs.json') as f: recent_blogs_json = json.load(f) requests_mock.post(api.base_url + "blog/get", json=recent_blogs_json) blogs_response = api.get_recent_blogs() assert blogs_response['response']['count'] == 3 assert len(blogs_response['response']['data']) == 3