def test_raw_json(self): data = stopspam.raw(self.bad_ip, 'json') try: data_j = json.loads(data) except: data_j = 'not json' self.assertEquals(data_j['success'], 1)
def test_raw_xml(self): data = stopspam.raw(self.bad_ip, 'xml') try: data_x = xml.fromstring(data) except: data_x = 'not xml' self.assertEquals(data_x['success'], 'true')
def test_raw_xml(self): data = stopspam.raw(self.bad_ip, 'xml') try: data_x = xml.fromstring(data) d = data_x.attrib except: pass self.assertEquals(d['success'], 'true')