OceanNetworksCanada / api-python-client

Provides easy access to ONC data in Python
https://oceannetworkscanada.github.io/api-python-client/
Apache License 2.0
10 stars 9 forks source link

Add tests for docstring and code examples #25

Closed kan-fu closed 5 months ago

kan-fu commented 6 months ago

Currently the docstring and jupyter notebooks in the Code Examples documentation are not tested.

Doctest is not enabled because every doctest needs to create a new ONC object with a token. pytest does have fixture support for doctest, but it will add unnecessary clutter and make the documentation harder to read.

Code Examples simply contains examples that are easy to break (like get all deployments).

These two tests are purposely excluded from the CI. They are expected to be run only in internal regression tests.

kan-fu commented 6 months ago

In the code examples documentation, load_dotenv is used to setup the token. This setup makes it easy for CI to run the code, but hard for new users to grasp the idea. I need to use jupytext to setup the test if load_dotenv is deleted from the code.