diff options
Diffstat (limited to 'searx/tests/engines/test_yahoo.py')
| -rw-r--r-- | searx/tests/engines/test_yahoo.py | 107 |
1 files changed, 47 insertions, 60 deletions
diff --git a/searx/tests/engines/test_yahoo.py b/searx/tests/engines/test_yahoo.py index e5c78701d..11ef9db22 100644 --- a/searx/tests/engines/test_yahoo.py +++ b/searx/tests/engines/test_yahoo.py @@ -55,37 +55,44 @@ class TestYahooEngine(SearxTestCase): self.assertEqual(yahoo.response(response), []) html = """ - <div class="res"> - <div> - <h3> - <a id="link-1" class="yschttl spt" href="http://r.search.yahoo.com/_ylt=A0LEVzClb9JUSKcAEGRXNyoA; - _ylu=X3oDMTEzZm1qazYwBHNlYwNzcgRwb3MDMQRjb2xvA2JmMQR2dGlkA1NNRTcwM18x/RV=2/RE=1423106085/RO=10 - /RU=https%3a%2f%2fthis.is.the.url%2f/RK=0/RS=dtcJsfP4mEeBOjnVfUQ-"target="_blank" data-bk="5063.1"> - <b>This</b> is the title - </a> +<ol class="reg mb-15 searchCenterMiddle"> + <li class="first"> + <div class="dd algo fst Sr"> + <div class="compTitle"> + <h3 class="title"><a class=" td-u" href="http://r.search.yahoo.com/_ylt=A0LEb9JUSKcAEGRXNyoA; + _ylu=X3oDMTEzZm1qazYwBHNlYwNzcgRwb3MDMQRjb2xvA2Jm2dGlkA1NNRTcwM18x/RV=2/RE=1423106085/RO=10 + /RU=https%3a%2f%2fthis.is.the.url%2f/RK=0/RS=dtcJsfP4mEeBOjnVfUQ-" + target="_blank" data-bid="54e712e13671c"> + <b><b>This is the title</b></b></a> </h3> </div> - <span class="url" dir="ltr">www.<b>test</b>.com</span> - <div class="abstr"> - <b>This</b> is the content + <div class="compText aAbs"> + <p class="lh-18"><b><b>This is the </b>content</b> + </p> </div> </div> - <div id="satat" data-bns="Yahoo" data-bk="124.1"> - <h2>Also Try</h2> - <table> - <tbody> - <tr> - <td> - <a id="srpnat0" class="" href="https://search.yahoo.com/search=rs-bottom" > - <span> - <b></b>This is <b>the suggestion</b> - </span> - </a> - </td> - </tr> - </tbody> - </table> + </li> + <li> + <div class="dd algo lst Sr"> + <div class="compTitle"> + </div> + <div class="compText aAbs"> + <p class="lh-18">This is the second content</p> + </div> </div> + </li> +</ol> +<div class="dd assist fst lst AlsoTry" data-bid="54e712e138d04"> + <div class="compTitle mb-4 h-17"> + <h3 class="title">Also Try</h3> </div> + <table class="compTable m-0 ac-1st td-u fz-ms"> + <tbody> + <tr> + <td class="w-50p pr-28"><a href="https://search.yahoo.com/"><B>This is the </B>suggestion<B></B></a> + </td> + </tr> + </table> +</div> """ response = mock.Mock(text=html) results = yahoo.response(response) @@ -97,44 +104,24 @@ class TestYahooEngine(SearxTestCase): self.assertEqual(results[1]['suggestion'], 'This is the suggestion') html = """ - <div class="res"> - <div> - <h3> - <a id="link-1" class="yschttl spt" href="http://r.search.yahoo.com/_ylt=A0LEVzClb9JUSKcAEGRXNyoA; - _ylu=X3oDMTEzZm1qazYwBHNlYwNzcgRwb3MDMQRjb2xvA2JmMQR2dGlkA1NNRTcwM18x/RV=2/RE=1423106085/RO=10 - /RU=https%3a%2f%2fthis.is.the.url%2f/RK=0/RS=dtcJsfP4mEeBOjnVfUQ-"target="_blank" data-bk="5063.1"> - <b>This</b> is the title - </a> - </h3> - </div> - <span class="url" dir="ltr">www.<b>test</b>.com</span> - <div class="abstr"> - <b>This</b> is the content - </div> - </div> - <div class="res"> - <div> - <h3> - <a id="link-1" class="yschttl spt"> - <b>This</b> is the title - </a> - </h3> - </div> - <span class="url" dir="ltr">www.<b>test</b>.com</span> - <div class="abstr"> - <b>This</b> is the content - </div> - </div> - <div class="res"> - <div> - <h3> +<ol class="reg mb-15 searchCenterMiddle"> + <li class="first"> + <div class="dd algo fst Sr"> + <div class="compTitle"> + <h3 class="title"><a class=" td-u" href="http://r.search.yahoo.com/_ylt=A0LEb9JUSKcAEGRXNyoA; + _ylu=X3oDMTEzZm1qazYwBHNlYwNzcgRwb3MDMQRjb2xvA2Jm2dGlkA1NNRTcwM18x/RV=2/RE=1423106085/RO=10 + /RU=https%3a%2f%2fthis.is.the.url%2f/RK=0/RS=dtcJsfP4mEeBOjnVfUQ-" + target="_blank" data-bid="54e712e13671c"> + <b><b>This is the title</b></b></a> </h3> </div> - <span class="url" dir="ltr">www.<b>test</b>.com</span> - <div class="abstr"> - <b>This</b> is the content + <div class="compText aAbs"> + <p class="lh-18"><b><b>This is the </b>content</b> + </p> </div> </div> + </li> +</ol> """ response = mock.Mock(text=html) results = yahoo.response(response) |