Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
    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'])
Esempio n. 4
0
    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'])
Esempio n. 5
0
    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)
Esempio n. 6
0
    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)
Esempio n. 7
0
    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)
Esempio n. 8
0
    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)