def test11(self): u"""" Парсинг новой выдачи """ html = self.get_data('google1-2015-07-24.html') g = GoogleParser(html) res = g.get_serp() #на самом деле тут 150000, но из-за того что кэш битый 0 self.assertEqual(res['pc'], 0) self.assertEqual(len(res['sn']), 100)
def test10(self): u"""" Парсинг новой выдачи """ html = self.get_data('google-2015-07-24.html') g = GoogleParser(html) res = g.get_serp() etalon = json.loads(self.get_data('google-2015-07-24.json')) self.assertEqual(res['pc'], etalon['pc']) self.assertEqual(len(res['sn']), len(etalon['sn'])) self.check2(etalon['sn'], res['sn'])
def test17(self): u"""" Парсинг новой выдачи """ html = self.get_data('2015-08-11-1.html') g = GoogleParser(html) res = g.get_serp() self.assertEqual(res['pc'], 416000) self.assertEqual(len(res['sn']), 10) pe = GoogleParser.pagination_exists(html) self.assertTrue(pe)
def test15(self): u"""" Парсинг новой выдачи """ html = self.get_data('google2-2015-07-27.html') g = GoogleParser(html) res = g.get_serp() self.assertEqual(res['pc'], 1) self.assertEqual(len(res['sn']), 1) pe = GoogleParser.pagination_exists(html) self.assertFalse(pe)