on master help sign in
[fix] pep8
commit0491b78f7034599a5573cdffaa8acc044d4d8720 authorAdam Tauber <asciimoo@gmail.com> dateMon 1 Feb 2016, 21:53 (11 years ago) parent33ff1de
2 files changed+14−11
tests/unit/engines/test_bing_images.py+7−4 tests/unit/engines/test_gigablast.py+7−7
tests/unit/engines/test_bing_images.py+7−4
@@ -44,17 +44,20 @@ class TestBingImagesEngine(SearxTestCase):
4444 </a>
4545
4646 </div>
47− """
47+ """ # noqa
4848 html = html.replace('\r\n', '').replace('\n', '').replace('\r', '')
4949 response = mock.Mock(text=html)
5050 results = bing_images.response(response)
5151 self.assertEqual(type(results), list)
5252 self.assertEqual(len(results), 1)
5353 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')
5556 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')
5861
5962 html = """
6063 <a href="#" ihk="HN.608003696942779811"
tests/unit/engines/test_gigablast.py+7−7
@@ -27,19 +27,19 @@ class TestGigablastEngine(SearxTestCase):
2727
2828 json = """{"results": [
2929 {
30− "title":"South by Southwest 2016 Music, Film and Interactive Festivals - Austin Texas",
30+ "title":"South by Southwest 2016",
3131 "dmozEntry":{
3232 "dmozCatId":1041152,
3333 "directCatId":1,
34− "dmozCatStr":"Top: Regional: North America: United States: Texas: Arts and Entertainment: Events",
34+ "dmozCatStr":"Top: Regional: North America: United States",
3535 "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.",
3737 "dmozAnchor":""
3838 },
3939 "dmozEntry":{
4040 "dmozCatId":763945,
4141 "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",
4343 "dmozTitle":"South by Southwest (SXSW)",
4444 "dmozSum":"",
4545 "dmozAnchor":"www.sxsw.com"
@@ -47,9 +47,9 @@ class TestGigablastEngine(SearxTestCase):
4747 "dmozEntry":{
4848 "dmozCatId":761446,
4949 "directCatId":1,
50− "dmozCatStr":"Top: Regional: North America: United States: Texas: Travel and Tourism: Attractions",
50+ "dmozCatStr":"Top: Regional: North America: United States",
5151 "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.",
5353 "dmozAnchor":""
5454 },
5555 "indirectDmozCatId":1041152,
@@ -80,6 +80,6 @@ class TestGigablastEngine(SearxTestCase):
8080 results = gigablast.response(response)
8181 self.assertEqual(type(results), list)
8282 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')
8484 self.assertEqual(results[0]['url'], 'www.sxsw.com')
8585 self.assertEqual(results[0]['content'], 'This should be the content.')