How to use the serpextract.get_all_query_params_by_domain function in serpextract

To help you get started, we’ve selected a few serpextract examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Parsely / serpextract / tests / test_serps.py View on Github external
def test_get_query_params_by_domain(self):
        """ make sure that individual subdomains are enumerated properly """
        params_by_domain = get_all_query_params_by_domain()
        google_params = [u'q', u'query']
        bing_params = [u'Q', u'q']
        baidu_params = [u'kw', u'wd', u'word']
        yahoo_params = [u'p', u'q', u'va']
        so_net_params = [u'kw', u'query']
        goo_ne_jp_params = [u'MT']
        t_online_params = [u'q']
        self.assertEqual(params_by_domain['google.com'], google_params)
        self.assertEqual(params_by_domain['google.de'], google_params)
        self.assertEqual(params_by_domain['google.co.uk'], google_params)
        self.assertEqual(params_by_domain['baidu.com'], baidu_params)
        self.assertEqual(params_by_domain['bing.com'], bing_params)
        self.assertEqual(params_by_domain['yahoo.com'], yahoo_params)
        self.assertEqual(params_by_domain['so-net.ne.jp'], so_net_params)
        self.assertEqual(params_by_domain['goo.ne.jp'], goo_ne_jp_params)
        self.assertEqual(params_by_domain['t-online.de'], t_online_params)