No project description provided
Project description
OARepo model builder tests
Plugin for oarepo-model-builder to generate test files and add test dependencies. The record service and its rest api are covered for now. Tests read, write, update, delete and search operations.The tests use automatically generated metadata in {model_name}/data/sample_data.yaml file to create records and upload them as fixtures.
Resource test:
test_get_item
: Tries to use the api to retrieve non existing and existing record. Should fail on the first task and success on second.test_create
: Tries to use the api to create a list of records. Also tries to use unauthorized client to do so, which should fail with http code 403. Then the test tries to retrieve the records and checks whether they contain the same metadata that they were uploaded with.test_listing
: Tries a get call on the base url to retrieve all saved records. Checks whether the correct number of records is retrieved.test_update
: Tries to update non-existing record. Then updates an existing record and checks whether the metadata are correctly updated and revision_id incremented.test_delete
: Tries to delete non-existing record. Then tries to delete an existing one and checks whether the get call return 410 error http code. Also checks that unauthorized client can't delete.test_search
: Finds all metadata fields generated in the test data. Then tries search based on values in the fields and checks whether at least one record with the same field value is returned. Tries search based on created time, with correct time, wrong time and as a facet.
The service tests are analogous, they only bypass the api and use the expected service methods directly.
Installation
model.yaml
model:
plugins:
packages:
- oarepo-model-builder-tests
command line
pip install oarepo-model-builder
pip install oarepo-model-builder-tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file oarepo-model-builder-tests-4.0.7.tar.gz
.
File metadata
- Download URL: oarepo-model-builder-tests-4.0.7.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5275bfd3701841d1d5b4941fefa37408a687deda55881a7aed0750a04196900 |
|
MD5 | a097da270dd6c5ce4a06b0a9b7cf5c88 |
|
BLAKE2b-256 | e6f413b7b9c870ae109e91d935f14a20903a7266f329fc881da553a75f730a81 |
File details
Details for the file oarepo_model_builder_tests-4.0.7-py3-none-any.whl
.
File metadata
- Download URL: oarepo_model_builder_tests-4.0.7-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9d6e244403fa1f73dc9355c88c455aa26ac40ff0643f04073f19da23e853ecf |
|
MD5 | 7cfacae649c484730625c26ae8e617fe |
|
BLAKE2b-256 | bc9d0e471536fe8b9850bd795a9f808cff0b4d3b344efbe9f93566852c65f874 |