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 View File

@@ -44,17 +44,20 @@ class TestBingImagesEngine(SearxTestCase):
44 44
             </a>
45 45
 
46 46
         </div>
47
-        """
47
+        """  # noqa
48 48
         html = html.replace('\r\n', '').replace('\n', '').replace('\r', '')
49 49
         response = mock.Mock(text=html)
50 50
         results = bing_images.response(response)
51 51
         self.assertEqual(type(results), list)
52 52
         self.assertEqual(len(results), 1)
53 53
         self.assertEqual(results[0]['title'], 'South Carolina')
54
-        self.assertEqual(results[0]['url'], 'http://www.digital-topo-maps.com/county-map/south-carolina.shtml')
54
+        self.assertEqual(results[0]['url'],
55
+                         'http://www.digital-topo-maps.com/county-map/south-carolina.shtml')
55 56
         self.assertEqual(results[0]['content'], '')
56
-        self.assertEqual(results[0]['thumbnail_src'], 'https://www.bing.com/th?id=OIP.Mbf3bc87efe6e0e476be8cc34bf6cd80eH0')
57
-        self.assertEqual(results[0]['img_src'], 'http://www.digital-topo-maps.com/county-map/south-carolina-county-map.gif')
57
+        self.assertEqual(results[0]['thumbnail_src'],
58
+                         'https://www.bing.com/th?id=OIP.Mbf3bc87efe6e0e476be8cc34bf6cd80eH0')
59
+        self.assertEqual(results[0]['img_src'],
60
+                         'http://www.digital-topo-maps.com/county-map/south-carolina-county-map.gif')
58 61
 
59 62
         html = """
60 63
         <a href="#" ihk="HN.608003696942779811"

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

@@ -27,19 +27,19 @@ class TestGigablastEngine(SearxTestCase):
27 27
 
28 28
         json = """{"results": [
29 29
     {
30
-        "title":"South by Southwest 2016 Music, Film and Interactive Festivals - Austin Texas",
30
+        "title":"South by Southwest 2016",
31 31
         "dmozEntry":{
32 32
             "dmozCatId":1041152,
33 33
             "directCatId":1,
34
-            "dmozCatStr":"Top: Regional: North America: United States: Texas: Arts and Entertainment: Events",
34
+            "dmozCatStr":"Top: Regional: North America: United States",
35 35
             "dmozTitle":"South by Southwest (SXSW)",
36
-            "dmozSum":"Annual music, film, and interactive conference and festival held in Austin. Includes schedules and band and film lists.",
36
+            "dmozSum":"Annual music, film, and interactive conference.",
37 37
             "dmozAnchor":""
38 38
         },
39 39
         "dmozEntry":{
40 40
             "dmozCatId":763945,
41 41
             "directCatId":1,
42
-            "dmozCatStr":"Top: Regional: North America: United States: Texas: Localities: A: Austin: Arts and Entertainment: Events",
42
+            "dmozCatStr":"Top: Regional: North America: United States",
43 43
             "dmozTitle":"South by Southwest (SXSW)",
44 44
             "dmozSum":"",
45 45
             "dmozAnchor":"www.sxsw.com"
@@ -47,9 +47,9 @@ class TestGigablastEngine(SearxTestCase):
47 47
         "dmozEntry":{
48 48
             "dmozCatId":761446,
49 49
             "directCatId":1,
50
-            "dmozCatStr":"Top: Regional: North America: United States: Texas: Travel and Tourism: Attractions",
50
+            "dmozCatStr":"Top: Regional: North America: United States",
51 51
             "dmozTitle":"South by Southwest (SXSW)",
52
-            "dmozSum":"Music, film, and interactive conference and festival. Includes schedules and band and film lists.",
52
+            "dmozSum":"Music, film, and interactive conference and festival.",
53 53
             "dmozAnchor":""
54 54
         },
55 55
         "indirectDmozCatId":1041152,
@@ -80,6 +80,6 @@ class TestGigablastEngine(SearxTestCase):
80 80
         results = gigablast.response(response)
81 81
         self.assertEqual(type(results), list)
82 82
         self.assertEqual(len(results), 1)
83
-        self.assertEqual(results[0]['title'], 'South by Southwest 2016 Music, Film and Interactive Festivals - Austin Texas')
83
+        self.assertEqual(results[0]['title'], 'South by Southwest 2016')
84 84
         self.assertEqual(results[0]['url'], 'www.sxsw.com')
85 85
         self.assertEqual(results[0]['content'], 'This should be the content.')