Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oarepo_model_builder_tests-4.0.9.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oarepo_model_builder_tests-4.0.9-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file oarepo_model_builder_tests-4.0.9.tar.gz.

File metadata

File hashes

Hashes for oarepo_model_builder_tests-4.0.9.tar.gz
Algorithm Hash digest
SHA256 183124874383b70b679181e222ac40c0bc37caf7d888b2594c4373d4c3b5aff2
MD5 d725ef19d3f616d957e78d3fe8fdde08
BLAKE2b-256 4bc0534e48a647701c826e680357db300d77ad4f0f35dd0140d2936b441a12de

See more details on using hashes here.

File details

Details for the file oarepo_model_builder_tests-4.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for oarepo_model_builder_tests-4.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 dbc04c0d36c8774f75894bbc04c9e544494cf26e0981c106b99cb339a4ee6b9c
MD5 8a29cff7aec5af4b07362ae5071c84b9
BLAKE2b-256 9761ec9b51d043dc77a64f8fa3c77c990e2c17fde8a3fe417a5703af0d01f178

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page