Skip to content

Commit

Permalink
One source of scraper names (fossasia#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored and vaibhavsingh97 committed Jan 10, 2018
1 parent 2a62cc9 commit db55ec9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ before_script:
- flake8 . --count --max-complexity=15 --show-source --statistics
script:
- python app/server.py > /dev/null &
- pytest --capture=sys
- pytest --capture=sys --showlocals
- kill $(lsof -t -i:7001)
after_success:
- codecov
6 changes: 1 addition & 5 deletions app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@
parser.add_argument("--dev", help=help_msg, action="store_true")
args = parser.parse_args()

search_engines = ["google", "yahoo", "bing", "ask", "duckduckgo", "yandex",
"youtube", "exalead", "mojeek", "dailymotion", "parsijoo",
"quora", "baidu"]


@app.route('/')
def index():
return render_template('index.html', engines_list=search_engines)
return render_template('index.html', engines_list=scrapers.keys())


def bad_request(error):
Expand Down
6 changes: 2 additions & 4 deletions app/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
import requests

from .scrapers import small_test
from .scrapers import scrapers, small_test

REASON = 'Do you have query-server running on http://127.0.0.1:7001 ?'
TRAVIS_CI = os.getenv('TRAVIS', False) # Running in Travis CI?
Expand All @@ -30,7 +30,5 @@ def make_engine_api_call(engine_name):

@pytest.mark.xfail(not TRAVIS_CI, reason=REASON)
def test_engine_api_calls(engine_names=None):
engines = """ask baidu bing dailymotion duckduckgo exalead google
mojeek parsijoo quora yahoo yandex youtube""".split()
for engine_name in (engine_names or engines):
for engine_name in (engine_names or scrapers):
make_engine_api_call(engine_name)

0 comments on commit db55ec9

Please sign in to comment.