Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def assertInvalidSERP(self, url, **kwargs):
self.assertIsNone(extract(url, **kwargs))
self.assertFalse(is_serp(url, **kwargs))
def assertValidSERP(self, url, expected_engine_name, expected_keyword, **kwargs):
# Test both the URL and a parsed URL version
for url in (url, urlparse(url)):
res = extract(url, **kwargs)
self.assertEqual(res.keyword, expected_keyword)
self.assertEqual(res.engine_name, expected_engine_name)
self.assertTrue(is_serp(url, **kwargs))