vaphes / pocketbase

PocketBase client SDK for python
https://pypi.org/project/pocketbase/
MIT License
332 stars 38 forks source link

add real-world API testing #17

Closed m29h closed 1 year ago

m29h commented 1 year ago

I added some comprehensive pytest test cases that test against a 'real-world' pocketbase instance.

For this the github actions tests.yml is modified to download and spawn the official pocketbase 0.11.3 image

For local testing during development one must manually launch an empty pocketbase instance. The real-world API tests are automatically skipped if no connection to 127.0.0.1:8090 can be established.

I am aware that technically this is not unit-testing any more, but from a pragmatic perspective it helps to test real-world functionality. Testing is covering pretty much all cases of the:

In total there are 24 test-cases added!

There are some minor bugfixes (to minor bugs i found through the dramatically improved test coverage) as well as some cosmetic changes. Note: the github-actions will only run all tests once the yml file is merged through to the master branch.

The test coverage gives me also much more confidence to have a v0.3 release soon.