Skip to main content

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

Metadata

Release files for oarepo-model-builder-tests 4.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oarepo-model-builder-tests 4.0.13
File Size Uploaded
oarepo_model_builder_tests-4.0.13.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oarepo-model-builder-tests 4.0.13
File Interpreter ABI Platform
oarepo_model_builder_tests-4.0.13-py3-none-any.whl Python 3 none any Details

Total release size: 25.4 kB

Release files / oarepo_model_builder_tests-4.0.13.tar.gz

Download URL oarepo_model_builder_tests-4.0.13.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
efabecab260ebe3c06feadc8c6753ba68f67bac3f63b855ef323505db97bc4bf
BLAKE2b-256 checksum
How to use checksums
80dca3e3a509ddc9f493543203f2ff640311427ac6e0410a8e287cc11fb2e507
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / oarepo_model_builder_tests-4.0.13-py3-none-any.whl

Download URL oarepo_model_builder_tests-4.0.13-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
364f8519b8c7c75252201ae2032e4e71f3e420c7e00acda07b1ca01efd684a36
BLAKE2b-256 checksum
How to use checksums
d86a3b09acc8d8dfcb81e53a85eaacd7c4108d62435b9875f22d72b6c0e8967b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

4.0.13 This release

2 release files

4.0.11

2 release files

4.0.9

2 release files

4.0.8

2 release files

4.0.7

2 release files

4.0.6

2 release files

4.0.5

2 release files

4.0.4

2 release files

4.0.3

2 release files

4.0.2

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page