summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-07-18 22:27:17 +0200
committerGitHub <noreply@github.com>2016-07-18 22:27:17 +0200
commitaa09f963eb8220f866334779f61741da8926fcf2 (patch)
tree37b9c3658374d6b8499be7713c8dc52c66e0be72 /tests/unit
parent21c5fb1c4514444a7c4fdecd84874f2b7c367f38 (diff)
parentb3ab221b9808ba2b7b01d417210af9b9527e661c (diff)
downloadsearxng-aa09f963eb8220f866334779f61741da8926fcf2.tar.gz
searxng-aa09f963eb8220f866334779f61741da8926fcf2.zip
Merge pull request #621 from stepshal/anomalous-backslash-in-string
Fix anomalous backslash in string
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/engines/test_dailymotion.py2
-rw-r--r--tests/unit/engines/test_deezer.py4
-rw-r--r--tests/unit/engines/test_flickr.py10
-rw-r--r--tests/unit/engines/test_flickr_noapi.py2
-rw-r--r--tests/unit/engines/test_ina.py24
-rw-r--r--tests/unit/engines/test_mediawiki.py2
-rw-r--r--tests/unit/engines/test_mixcloud.py2
-rw-r--r--tests/unit/engines/test_searchcode_code.py2
-rw-r--r--tests/unit/engines/test_searchcode_doc.py2
-rw-r--r--tests/unit/engines/test_wolframalpha_noapi.py6
10 files changed, 28 insertions, 28 deletions
diff --git a/tests/unit/engines/test_dailymotion.py b/tests/unit/engines/test_dailymotion.py
index 4c31ff5d5..368b3a7a5 100644
--- a/tests/unit/engines/test_dailymotion.py
+++ b/tests/unit/engines/test_dailymotion.py
@@ -62,7 +62,7 @@ class TestDailymotionEngine(SearxTestCase):
self.assertEqual(results[0]['content'], 'Description')
self.assertIn('x2fit7q', results[0]['embedded'])
- json = """
+ json = r"""
{"toto":[
{"id":200,"name":"Artist Name",
"link":"http:\/\/www.dailymotion.com\/artist\/1217","type":"artist"}
diff --git a/tests/unit/engines/test_deezer.py b/tests/unit/engines/test_deezer.py
index ad09d2a2c..cfef852af 100644
--- a/tests/unit/engines/test_deezer.py
+++ b/tests/unit/engines/test_deezer.py
@@ -27,7 +27,7 @@ class TestDeezerEngine(SearxTestCase):
response = mock.Mock(text='{"data": []}')
self.assertEqual(deezer.response(response), [])
- json = """
+ json = r"""
{"data":[
{"id":100, "title":"Title of track",
"link":"https:\/\/www.deezer.com\/track\/1094042","duration":232,
@@ -45,7 +45,7 @@ class TestDeezerEngine(SearxTestCase):
self.assertEqual(results[0]['content'], 'Artist Name &bull; Album Title &bull; Title of track')
self.assertTrue('100' in results[0]['embedded'])
- json = """
+ json = r"""
{"data":[
{"id":200,"name":"Artist Name",
"link":"https:\/\/www.deezer.com\/artist\/1217","type":"artist"}
diff --git a/tests/unit/engines/test_flickr.py b/tests/unit/engines/test_flickr.py
index 8b39e922f..2d7472a92 100644
--- a/tests/unit/engines/test_flickr.py
+++ b/tests/unit/engines/test_flickr.py
@@ -27,7 +27,7 @@ class TestFlickrEngine(SearxTestCase):
response = mock.Mock(text='{"data": []}')
self.assertEqual(flickr.response(response), [])
- json = """
+ json = r"""
{ "photos": { "page": 1, "pages": "41001", "perpage": 100, "total": "4100032",
"photo": [
{ "id": "15751017054", "owner": "66847915@N08",
@@ -55,7 +55,7 @@ class TestFlickrEngine(SearxTestCase):
self.assertTrue('Owner' in results[0]['content'])
self.assertTrue('Description' in results[0]['content'])
- json = """
+ json = r"""
{ "photos": { "page": 1, "pages": "41001", "perpage": 100, "total": "4100032",
"photo": [
{ "id": "15751017054", "owner": "66847915@N08",
@@ -79,7 +79,7 @@ class TestFlickrEngine(SearxTestCase):
self.assertTrue('Owner' in results[0]['content'])
self.assertTrue('Description' in results[0]['content'])
- json = """
+ json = r"""
{ "photos": { "page": 1, "pages": "41001", "perpage": 100, "total": "4100032",
"photo": [
{ "id": "15751017054", "owner": "66847915@N08",
@@ -103,7 +103,7 @@ class TestFlickrEngine(SearxTestCase):
self.assertTrue('Owner' in results[0]['content'])
self.assertTrue('Description' in results[0]['content'])
- json = """
+ json = r"""
{ "photos": { "page": 1, "pages": "41001", "perpage": 100, "total": "4100032",
"photo": [
{ "id": "15751017054", "owner": "66847915@N08",
@@ -130,7 +130,7 @@ class TestFlickrEngine(SearxTestCase):
self.assertEqual(type(results), list)
self.assertEqual(len(results), 0)
- json = """
+ json = r"""
{"toto":[
{"id":200,"name":"Artist Name",
"link":"http:\/\/www.flickr.com\/artist\/1217","type":"artist"}
diff --git a/tests/unit/engines/test_flickr_noapi.py b/tests/unit/engines/test_flickr_noapi.py
index 3b337a2d8..42f38f90b 100644
--- a/tests/unit/engines/test_flickr_noapi.py
+++ b/tests/unit/engines/test_flickr_noapi.py
@@ -316,7 +316,7 @@ class TestFlickrNoapiEngine(SearxTestCase):
self.assertEqual(len(results), 0)
# garbage test
- json = """
+ json = r"""
{"toto":[
{"id":200,"name":"Artist Name",
"link":"http:\/\/www.flickr.com\/artist\/1217","type":"artist"}
diff --git a/tests/unit/engines/test_ina.py b/tests/unit/engines/test_ina.py
index 2c87a0ff8..109a9592d 100644
--- a/tests/unit/engines/test_ina.py
+++ b/tests/unit/engines/test_ina.py
@@ -33,23 +33,23 @@ class TestInaEngine(SearxTestCase):
<div class=\\"search-results--list\\"><div class=\\"media\\">\\n\
\\t\\t\\t\\t<a class=\\"media-left media-video premium xiti_click_action\\" \
data-xiti-params=\\"recherche_v4::resultats_conference_de_presse_du_general_de_gaulle::N\\" \
- href=\\"\/video\/CAF89035682\/conference-de-presse-du-general-de-gaulle-video.html\\">\\n\
- <img src=\\"https:\/\/www.ina.fr\/images_v2\/140x105\/CAF89035682.jpeg\\" \
+ href=\\"\\/video\\/CAF89035682\\/conference-de-presse-du-general-de-gaulle-video.html\\">\\n\
+ <img src=\\"https:\\/\\/www.ina.fr\\/images_v2\\/140x105\\/CAF89035682.jpeg\\" \
alt=\\"Conf\\u00e9rence de presse du G\\u00e9n\\u00e9ral de Gaulle \\">\\n\
- \\t\\t\\t\\t\\t<\/a>\\n\
+ \\t\\t\\t\\t\\t<\\/a>\\n\
\\t\\t\\t\\t\\t<div class=\\"media-body\\">\\n\\t\\t\\t\\t\\t\\t<h3 class=\\"h3--title media-heading\\">\\n\
\\t\\t\\t\\t\\t\\t\\t<a class=\\"xiti_click_action\\" \
data-xiti-params=\\"recherche_v4::resultats_conference_de_presse_du_general_de_gaulle::N\\" \
- href=\\"\/video\/CAF89035682\/conference-de-presse-du-general-de-gaulle-video.html\\">\
- Conf\\u00e9rence de presse du G\\u00e9n\\u00e9ral de Gaulle <\/a>\\n\
- <\/h3>\\n\
- <div class=\\"media-body__info\\">\\n<span class=\\"broadcast\\">27\/11\/1967<\/span>\\n\
- <span class=\\"views\\">29321 vues<\/span>\\n\
- <span class=\\"duration\\">01h 33m 07s<\/span>\\n\
- <\/div>\\n\
+ href=\\"\\/video\\/CAF89035682\\/conference-de-presse-du-general-de-gaulle-video.html\\">\
+ Conf\\u00e9rence de presse du G\\u00e9n\\u00e9ral de Gaulle <\\/a>\\n\
+ <\\/h3>\\n\
+ <div class=\\"media-body__info\\">\\n<span class=\\"broadcast\\">27\\/11\\/1967<\\/span>\\n\
+ <span class=\\"views\\">29321 vues<\\/span>\\n\
+ <span class=\\"duration\\">01h 33m 07s<\\/span>\\n\
+ <\\/div>\\n\
<p class=\\"media-body__summary\\">VERSION INTEGRALE DE LA CONFERENCE DE PRESSE DU GENERAL DE GAULLE . \
- - PA le Pr\\u00e9sident DE GAULLE : il ouvre les bras et s'assied. DP journalis...<\/p>\\n\
- <\/div>\\n<\/div><!-- \/.media -->\\n"
+ - PA le Pr\\u00e9sident DE GAULLE : il ouvre les bras et s'assied. DP journalis...<\\/p>\\n\
+ <\\/div>\\n<\\/div><!-- \\/.media -->\\n"
}
"""
response = mock.Mock(text=json)
diff --git a/tests/unit/engines/test_mediawiki.py b/tests/unit/engines/test_mediawiki.py
index 63f7da6b2..b86372700 100644
--- a/tests/unit/engines/test_mediawiki.py
+++ b/tests/unit/engines/test_mediawiki.py
@@ -118,7 +118,7 @@ class TestMediawikiEngine(SearxTestCase):
self.assertEqual(type(results), list)
self.assertEqual(len(results), 0)
- json = """
+ json = r"""
{"toto":[
{"id":200,"name":"Artist Name",
"link":"http:\/\/www.mediawiki.com\/artist\/1217","type":"artist"}
diff --git a/tests/unit/engines/test_mixcloud.py b/tests/unit/engines/test_mixcloud.py
index a2ea47cf9..9c79a478e 100644
--- a/tests/unit/engines/test_mixcloud.py
+++ b/tests/unit/engines/test_mixcloud.py
@@ -55,7 +55,7 @@ class TestMixcloudEngine(SearxTestCase):
self.assertEqual(results[0]['content'], 'User')
self.assertTrue('http://www.mixcloud.com/user/this-is-the-url/' in results[0]['embedded'])
- json = """
+ json = r"""
{"toto":[
{"id":200,"name":"Artist Name",
"link":"http:\/\/www.mixcloud.com\/artist\/1217","type":"artist"}
diff --git a/tests/unit/engines/test_searchcode_code.py b/tests/unit/engines/test_searchcode_code.py
index c0ac2025c..955aea111 100644
--- a/tests/unit/engines/test_searchcode_code.py
+++ b/tests/unit/engines/test_searchcode_code.py
@@ -63,7 +63,7 @@ class TestSearchcodeCodeEngine(SearxTestCase):
self.assertEqual(results[0]['repository'], 'https://repo')
self.assertEqual(results[0]['code_language'], 'cpp')
- json = """
+ json = r"""
{"toto":[
{"id":200,"name":"Artist Name",
"link":"http:\/\/www.searchcode_code.com\/artist\/1217","type":"artist"}
diff --git a/tests/unit/engines/test_searchcode_doc.py b/tests/unit/engines/test_searchcode_doc.py
index b9dcf380b..7228613ed 100644
--- a/tests/unit/engines/test_searchcode_doc.py
+++ b/tests/unit/engines/test_searchcode_doc.py
@@ -61,7 +61,7 @@ class TestSearchcodeDocEngine(SearxTestCase):
self.assertIn('test', results[0]['content'])
self.assertIn('Description', results[0]['content'])
- json = """
+ json = r"""
{"toto":[
{"id":200,"name":"Artist Name",
"link":"http:\/\/www.searchcode_doc.com\/artist\/1217","type":"artist"}
diff --git a/tests/unit/engines/test_wolframalpha_noapi.py b/tests/unit/engines/test_wolframalpha_noapi.py
index 068c1be79..a8f73470e 100644
--- a/tests/unit/engines/test_wolframalpha_noapi.py
+++ b/tests/unit/engines/test_wolframalpha_noapi.py
@@ -28,7 +28,7 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
request = Request(headers={'Referer': referer_url})
# test failure
- json = '''
+ json = r'''
{"queryresult" : {
"success" : false,
"error" : false,
@@ -42,7 +42,7 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
self.assertEqual(wolframalpha_noapi.response(response), [])
# test basic case
- json = '''
+ json = r'''
{"queryresult" : {
"success" : true,
"error" : false,
@@ -143,7 +143,7 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
self.assertEqual('Wolfram|Alpha', results[1]['title'])
# test calc
- json = """
+ json = r"""
{"queryresult" : {
"success" : true,
"error" : false,