def test_strip_jsonp(self):
    stripped = strip_jsonp('cb ([ {"id":"532cb",\n\n\n"x":\n3}\n]\n);')
    d = json.loads(stripped)
    self.assertEqual(d, [{'id': '532cb', 'x': 3}])
    stripped = strip_jsonp('parseMetadata({"STATUS":"OK"})\n\n\n//epc')
    d = json.loads(stripped)
    self.assertEqual(d, {'STATUS': 'OK'})
    stripped = strip_jsonp('ps.embedHandler({"status": "success"});')
    d = json.loads(stripped)
    self.assertEqual(d, {'status': 'success'})
    stripped = strip_jsonp('window.cb && window.cb({"status": "success"});')
    d = json.loads(stripped)
    self.assertEqual(d, {'status': 'success'})
    stripped = strip_jsonp('window.cb && cb({"status": "success"});')
    d = json.loads(stripped)
    self.assertEqual(d, {'status': 'success'})
    stripped = strip_jsonp('({"status": "success"});')
    d = json.loads(stripped)
    self.assertEqual(d, {'status': 'success'})
def test_strip_jsonp(self):
    stripped = strip_jsonp('cb ([ {"id":"532cb",\n\n\n"x":\n3}\n]\n);')
    d = json.loads(stripped)
    self.assertEqual(d, [{'id': '532cb', 'x': 3}])
    stripped = strip_jsonp('parseMetadata({"STATUS":"OK"})\n\n\n//epc')
    d = json.loads(stripped)
    self.assertEqual(d, {'STATUS': 'OK'})
    stripped = strip_jsonp('ps.embedHandler({"status": "success"});')
    d = json.loads(stripped)
    self.assertEqual(d, {'status': 'success'})
    stripped = strip_jsonp('window.cb && window.cb({"status": "success"});')
    d = json.loads(stripped)
    self.assertEqual(d, {'status': 'success'})
    stripped = strip_jsonp('window.cb && cb({"status": "success"});')
    d = json.loads(stripped)
    self.assertEqual(d, {'status': 'success'})
    stripped = strip_jsonp('({"status": "success"});')
    d = json.loads(stripped)
    self.assertEqual(d, {'status': 'success'})