Skip to content

Commit 0508a4f

Browse files
committed
Don't import from router in test_score_set.py.
1 parent 3be7945 commit 0508a4f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/routers/test_score_set.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from unittest.mock import patch
99

1010
import jsonschema
11-
from mavedb.routers.score_sets import SCORE_SET_SEARCH_MAX_LIMIT, SCORE_SET_SEARCH_MAX_PUBLICATION_IDENTIFIERS
1211
import pytest
1312
from humps import camelize
1413
from sqlalchemy import select
@@ -1869,12 +1868,12 @@ def test_search_public_score_sets_invalid_limit(session, data_provider, client,
18691868
publish_score_set(client, score_set["urn"])
18701869
worker_queue.assert_called_once()
18711870

1872-
search_payload = {"text": "fnord", "limit": SCORE_SET_SEARCH_MAX_LIMIT + 1}
1871+
search_payload = {"text": "fnord", "limit": 101}
18731872
response = client.post("/api/v1/score-sets/search", json=search_payload)
18741873
response_data = response.json()
18751874
assert response.status_code == 422
18761875
assert (
1877-
f"Cannot search for more than {SCORE_SET_SEARCH_MAX_LIMIT} score sets at a time. Please use the offset and limit parameters to run a paginated search."
1876+
f"Cannot search for more than 100 score sets at a time. Please use the offset and limit parameters to run a paginated search."
18781877
in response_data["detail"]
18791878
)
18801879

@@ -1888,7 +1887,7 @@ def test_search_public_score_sets_valid_limit(session, data_provider, client, se
18881887
publish_score_set(client, score_set["urn"])
18891888
worker_queue.assert_called_once()
18901889

1891-
search_payload = {"text": "fnord", "limit": SCORE_SET_SEARCH_MAX_LIMIT}
1890+
search_payload = {"text": "fnord", "limit": 100}
18921891
response = client.post("/api/v1/score-sets/search", json=search_payload)
18931892
assert response.status_code == 200
18941893
assert response.json()["numScoreSets"] == 1
@@ -1907,13 +1906,13 @@ def test_search_public_score_sets_too_many_publication_identifiers(
19071906
publish_score_set(client, score_set["urn"])
19081907
worker_queue.assert_called_once()
19091908

1910-
publication_identifier_search = [str(20711194 + i) for i in range(SCORE_SET_SEARCH_MAX_PUBLICATION_IDENTIFIERS + 1)]
1909+
publication_identifier_search = [str(20711194 + i) for i in range(41)]
19111910
search_payload = {"text": "fnord", "publication_identifiers": publication_identifier_search}
19121911
response = client.post("/api/v1/score-sets/search", json=search_payload)
19131912
response_data = response.json()
19141913
assert response.status_code == 422
19151914
assert (
1916-
f"Cannot search for score sets belonging to more than {SCORE_SET_SEARCH_MAX_PUBLICATION_IDENTIFIERS} publication identifiers at once."
1915+
f"Cannot search for score sets belonging to more than 40 publication identifiers at once."
19171916
in response_data["detail"]
19181917
)
19191918

0 commit comments

Comments
 (0)