summaryrefslogtreecommitdiffstats
path: root/python/tests/web_search.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests/web_search.py')
-rw-r--r--python/tests/web_search.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/python/tests/web_search.py b/python/tests/web_search.py
index e3d19878..e34cd065 100644
--- a/python/tests/web_search.py
+++ b/python/tests/web_search.py
@@ -7,8 +7,32 @@ from fatcat_openapi_client.rest import ApiException
from fixtures import *
+def test_generic_search(app):
+
+ rv = app.get('/search?q=blood')
+ assert rv.status_code == 301
+ assert "/release/search" in rv.location
+
+ # file sha1sum
+ rv = app.get('/search?q=0262d5351e8e7a0af27af8ceaf7b4e581da085f2')
+ assert rv.status_code == 301
+ assert "/file/lookup" in rv.location
+
+ # PMCID
+ rv = app.get('/search?q=PMC12345')
+ assert rv.status_code == 301
+ assert "/release/lookup" in rv.location
+
+ # ISSN
+ rv = app.get('/search?q=1234-5678')
+ assert rv.status_code == 301
+ assert "/container/lookup" in rv.location
+
def test_release_search(app, mocker):
+ rv = app.get('/release/search')
+ assert rv.status_code == 200
+
with open('tests/files/elastic_release_search.json') as f:
elastic_resp=json.loads(f.read())
@@ -24,6 +48,9 @@ def test_release_search(app, mocker):
def test_container_search(app, mocker):
+ rv = app.get('/container/search')
+ assert rv.status_code == 200
+
with open('tests/files/elastic_container_search.json') as f:
elastic_resp=json.loads(f.read())