An open API service indexing awesome lists of open source software.

https://github.com/libris/lxl_api_tests

Integration tests for Libris XL API
https://github.com/libris/lxl_api_tests

Last synced: 5 months ago
JSON representation

Integration tests for Libris XL API

Awesome Lists containing this project

README

          

# lxl_api_tests

This is a collection of integration tests for the LibrisXL API.

## Dependencies

`libssl-dev`

## Configuration

We use environment variables to configure which system to run the tests against as well as which system to use for
authorization. The following variables need to be set before executing the tests:

- `LXLTESTING_LOGIN_URL` - URL to the oauth server e.g. `https://login.libris.kb.se` or a local xl_auth instance.
- `LXLTESTING_USERNAME` and `LXLTESTING_PASSWORD` - user credentials for the oauth server.
- `LXLTESTING_OAUTH_CLIENT_ID` - client ID for an oauth client that is configured to redirect to the system under test.
- `LXLTESTING_ROOT_URL` - path to the Libris XL rest API, defaults to `http://libris.kb.se.localhost:5000`.
To be able to run without https against e.g. localhost, set:
`export OAUTHLIB_INSECURE_TRANSPORT=1`

## Running

```bash
# First install uv: https://github.com/astral-sh/uv
# Then run the tests:
$ LXLTESTING_LOGIN_URL=https://some.host LXLTESTING_USERNAME=username \
LXLTESTING_PASSWORD=password LXLTESTING_OAUTH_CLIENT_ID=client-id uv run pytest
```

Environment variables can also be kept in a run configuration for this project if running the tests in an IDE.