-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/functional: Add a simple test for /corpus_config
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
""" | ||
test_corpus_config.py | ||
Pytest tests for the Korp /corpus_config endpoint | ||
""" | ||
|
||
|
||
from tests.testutils import get_response_json | ||
|
||
|
||
class TestCorpusConfig: | ||
|
||
"""Tests for /corpus_config""" | ||
|
||
def test_corpus_config(self, client, corpus_configs): | ||
"""Test that a corpus configuration can be retrieved.""" | ||
data = get_response_json( | ||
client, "/corpus_config", | ||
query_string={ | ||
"mode": "default", | ||
"cache": "false", | ||
}) | ||
# TODO: Add more assertions | ||
assert data["label"] | ||
assert data["corpora"] | ||
assert data["modes"] | ||
corpus_config = data["corpora"]["testcorpus"] | ||
assert corpus_config | ||
assert corpus_config["pos_attributes"] | ||
assert corpus_config["struct_attributes"] | ||
# print(data) | ||
# assert 0 |