Browse Source

[fix] pep8

Adam Tauber 9 years ago
parent
commit
0491b78f70
2 changed files with 14 additions and 11 deletions
  1. 7 4
      tests/unit/engines/test_bing_images.py
  2. 7 7
      tests/unit/engines/test_gigablast.py

+ 7 - 4
tests/unit/engines/test_bing_images.py

@@ -44,17 +44,20 @@ class TestBingImagesEngine(SearxTestCase):
             </a>
             </a>
 
 
         </div>
         </div>
-        """
+        """  # noqa
         html = html.replace('\r\n', '').replace('\n', '').replace('\r', '')
         html = html.replace('\r\n', '').replace('\n', '').replace('\r', '')
         response = mock.Mock(text=html)
         response = mock.Mock(text=html)
         results = bing_images.response(response)
         results = bing_images.response(response)
         self.assertEqual(type(results), list)
         self.assertEqual(type(results), list)
         self.assertEqual(len(results), 1)
         self.assertEqual(len(results), 1)
         self.assertEqual(results[0]['title'], 'South Carolina')
         self.assertEqual(results[0]['title'], 'South Carolina')
-        self.assertEqual(results[0]['url'], 'http://www.digital-topo-maps.com/county-map/south-carolina.shtml')
+        self.assertEqual(results[0]['url'],
+                         'http://www.digital-topo-maps.com/county-map/south-carolina.shtml')
         self.assertEqual(results[0]['content'], '')
         self.assertEqual(results[0]['content'], '')
-        self.assertEqual(results[0]['thumbnail_src'], 'https://www.bing.com/th?id=OIP.Mbf3bc87efe6e0e476be8cc34bf6cd80eH0')
-        self.assertEqual(results[0]['img_src'], 'http://www.digital-topo-maps.com/county-map/south-carolina-county-map.gif')
+        self.assertEqual(results[0]['thumbnail_src'],
+                         'https://www.bing.com/th?id=OIP.Mbf3bc87efe6e0e476be8cc34bf6cd80eH0')
+        self.assertEqual(results[0]['img_src'],
+                         'http://www.digital-topo-maps.com/county-map/south-carolina-county-map.gif')
 
 
         html = """
         html = """
         <a href="#" ihk="HN.608003696942779811"
         <a href="#" ihk="HN.608003696942779811"

+ 7 - 7
tests/unit/engines/test_gigablast.py

@@ -27,19 +27,19 @@ class TestGigablastEngine(SearxTestCase):
 
 
         json = """{"results": [
         json = """{"results": [
     {
     {
-        "title":"South by Southwest 2016 Music, Film and Interactive Festivals - Austin Texas",
+        "title":"South by Southwest 2016",
         "dmozEntry":{
         "dmozEntry":{
             "dmozCatId":1041152,
             "dmozCatId":1041152,
             "directCatId":1,
             "directCatId":1,
-            "dmozCatStr":"Top: Regional: North America: United States: Texas: Arts and Entertainment: Events",
+            "dmozCatStr":"Top: Regional: North America: United States",
             "dmozTitle":"South by Southwest (SXSW)",
             "dmozTitle":"South by Southwest (SXSW)",
-            "dmozSum":"Annual music, film, and interactive conference and festival held in Austin. Includes schedules and band and film lists.",
+            "dmozSum":"Annual music, film, and interactive conference.",
             "dmozAnchor":""
             "dmozAnchor":""
         },
         },
         "dmozEntry":{
         "dmozEntry":{
             "dmozCatId":763945,
             "dmozCatId":763945,
             "directCatId":1,
             "directCatId":1,
-            "dmozCatStr":"Top: Regional: North America: United States: Texas: Localities: A: Austin: Arts and Entertainment: Events",
+            "dmozCatStr":"Top: Regional: North America: United States",
             "dmozTitle":"South by Southwest (SXSW)",
             "dmozTitle":"South by Southwest (SXSW)",
             "dmozSum":"",
             "dmozSum":"",
             "dmozAnchor":"www.sxsw.com"
             "dmozAnchor":"www.sxsw.com"
@@ -47,9 +47,9 @@ class TestGigablastEngine(SearxTestCase):
         "dmozEntry":{
         "dmozEntry":{
             "dmozCatId":761446,
             "dmozCatId":761446,
             "directCatId":1,
             "directCatId":1,
-            "dmozCatStr":"Top: Regional: North America: United States: Texas: Travel and Tourism: Attractions",
+            "dmozCatStr":"Top: Regional: North America: United States",
             "dmozTitle":"South by Southwest (SXSW)",
             "dmozTitle":"South by Southwest (SXSW)",
-            "dmozSum":"Music, film, and interactive conference and festival. Includes schedules and band and film lists.",
+            "dmozSum":"Music, film, and interactive conference and festival.",
             "dmozAnchor":""
             "dmozAnchor":""
         },
         },
         "indirectDmozCatId":1041152,
         "indirectDmozCatId":1041152,
@@ -80,6 +80,6 @@ class TestGigablastEngine(SearxTestCase):
         results = gigablast.response(response)
         results = gigablast.response(response)
         self.assertEqual(type(results), list)
         self.assertEqual(type(results), list)
         self.assertEqual(len(results), 1)
         self.assertEqual(len(results), 1)
-        self.assertEqual(results[0]['title'], 'South by Southwest 2016 Music, Film and Interactive Festivals - Austin Texas')
+        self.assertEqual(results[0]['title'], 'South by Southwest 2016')
         self.assertEqual(results[0]['url'], 'www.sxsw.com')
         self.assertEqual(results[0]['url'], 'www.sxsw.com')
         self.assertEqual(results[0]['content'], 'This should be the content.')
         self.assertEqual(results[0]['content'], 'This should be the content.')