aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/web_refs.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-02 18:13:14 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-11-02 18:13:14 -0700
commitcdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7 (patch)
tree5e4034027b51f3ee4d2a488bb2cbb7a75c3bd0d8 /python/tests/web_refs.py
parent78f08280edea4ff65ca613ad30005c45cc48dea6 (diff)
downloadfatcat-cdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7.tar.gz
fatcat-cdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7.zip
fmt (black): tests/
Diffstat (limited to 'python/tests/web_refs.py')
-rw-r--r--python/tests/web_refs.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/python/tests/web_refs.py b/python/tests/web_refs.py
index 0ab69607..61966480 100644
--- a/python/tests/web_refs.py
+++ b/python/tests/web_refs.py
@@ -1,4 +1,3 @@
-
import json
import pytest
@@ -10,14 +9,14 @@ from fatcat_web.search import get_elastic_container_random_releases
def test_basic_refs(app, mocker):
- with open('tests/files/elastic_refs_in_release.json') as f:
+ with open("tests/files/elastic_refs_in_release.json") as f:
elastic_resp_in = json.loads(f.read())
- with open('tests/files/elastic_refs_out_release.json') as f:
+ with open("tests/files/elastic_refs_out_release.json") as f:
elastic_resp_out = json.loads(f.read())
- with open('tests/files/elastic_empty.json') as f:
+ with open("tests/files/elastic_empty.json") as f:
elastic_resp_empty = json.loads(f.read())
- es_raw = mocker.patch('elasticsearch.connection.Urllib3HttpConnection.perform_request')
+ es_raw = mocker.patch("elasticsearch.connection.Urllib3HttpConnection.perform_request")
es_raw.side_effect = [
(200, {}, json.dumps(elastic_resp_in)),
(200, {}, json.dumps(elastic_resp_in)),
@@ -28,27 +27,27 @@ def test_basic_refs(app, mocker):
]
# render refs-in
- rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-in')
+ rv = app.get("/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-in")
assert rv.status_code == 200
assert b"Why Most Published Research Findings Are False" in rv.data
- rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-in.json')
+ rv = app.get("/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-in.json")
assert rv.status_code == 200
# empty (in)
- rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-in')
+ rv = app.get("/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-in")
assert rv.status_code == 200
assert b"No References Found" in rv.data
# render refs-out
- rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-out')
+ rv = app.get("/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-out")
assert rv.status_code == 200
assert b"Why Most Published Research Findings Are False" in rv.data
- rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-out.json')
+ rv = app.get("/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-out.json")
assert rv.status_code == 200
# empty (out)
- rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-out')
+ rv = app.get("/release/aaaaaaaaaaaaarceaaaaaaaaai/refs-out")
assert rv.status_code == 200
assert b"No References Found" in rv.data