Ejemplo n.º 1
0
 def test_get(self):
     orig_url = self.base_url + "?format=" + self.result_format + "&query=" + self.query + "&user_email="
     url = oauth.get_emailage_url("GET", orig_url, self.account_sid, self.auth_token)
     req = requests.get(url)
     resp = literal_eval(req.content.decode('utf-8-sig'))
     logging.debug(resp)
     assert resp['query']['results'][0]['EAScore'], "EA Score not found."
Ejemplo n.º 2
0
 def test_post(self):
     orig_url = self.base_url + "?format=" + self.result_format
     url = oauth.get_emailage_url("POST", orig_url, self.account_sid, self.auth_token)
     data = self.query
     req = requests.post(url, data=data)
     resp = literal_eval(req.content.decode('utf-8-sig'))
     assert resp['query']['results'][0]['EAScore'], "EA Score not found. {}".format(resp)
Ejemplo n.º 3
0
 def test_post_xml(self):
     orig_url = self.base_url + "?format=xml"
     url = oauth.get_emailage_url("POST", orig_url, self.account_sid, self.auth_token)
     data = self.query
     req = requests.post(url, data=data)
     rex = re.compile(r'<EAScore>(.*?)</EAScore>')
     match = rex.search(req.content.decode('utf-8-sig'))
     assert match.groups()[0].strip(), req.content