aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_web/search.py2
-rw-r--r--python/tests/web_coverage.py16
-rw-r--r--python/tests/web_search.py2
3 files changed, 4 insertions, 16 deletions
diff --git a/python/fatcat_web/search.py b/python/fatcat_web/search.py
index 78cde383..90575818 100644
--- a/python/fatcat_web/search.py
+++ b/python/fatcat_web/search.py
@@ -496,7 +496,7 @@ def get_elastic_container_preservation_by_year(container_id: str) -> List[dict]:
"""
Fetches a stacked histogram of {year, preservation}.
- Preservation has 4 potential values; this function filters to the past 250
+ Preservation has 4 potential values; this function filters to the past 250
years (at most), or about 1000 values.
Returns a list of dicts, sorted by year, with keys/values like:
diff --git a/python/tests/web_coverage.py b/python/tests/web_coverage.py
index 3aaca07c..3af4e719 100644
--- a/python/tests/web_coverage.py
+++ b/python/tests/web_coverage.py
@@ -65,19 +65,7 @@ def test_container_coverage(app, mocker):
def test_coverage_empty_years(app, mocker):
- elastic_resp1 = {
- 'timed_out': False,
- 'aggregations': {
- 'container_stats': {'buckets': {
- 'is_preserved': {'doc_count': 461939},
- 'in_kbart': {'doc_count': 461939},
- 'in_web': {'doc_count': 2797}}}},
- 'hits': {'total': 461939, 'hits': [], 'max_score': 0.0},
- '_shards': {'successful': 5, 'total': 5, 'skipped': 0, 'failed': 0},
- 'took': 50
- }
-
- elastic_resp2 = {
+ elastic_resp = {
'took': 294,
'timed_out': False,
'_shards': {'total': 5, 'successful': 5, 'skipped': 0, 'failed': 0},
@@ -91,7 +79,7 @@ def test_coverage_empty_years(app, mocker):
es_raw = mocker.patch('elasticsearch.connection.Urllib3HttpConnection.perform_request')
es_raw.side_effect = [
- (200, {}, json.dumps(elastic_resp2)),
+ (200, {}, json.dumps(elastic_resp)),
]
rv = app.get('/container/aaaaaaaaaaaaaeiraaaaaaaaam/ia_coverage_years.svg')
diff --git a/python/tests/web_search.py b/python/tests/web_search.py
index c90ad6e5..ef736969 100644
--- a/python/tests/web_search.py
+++ b/python/tests/web_search.py
@@ -2,7 +2,7 @@
import json
import pytest
-from fatcat_web.search import get_elastic_container_random_releases, get_elastic_container_histogram
+from fatcat_web.search import get_elastic_container_random_releases
from fatcat_openapi_client.rest import ApiException
from fixtures import *