https://github.com/zemfrog/zemfrog-test
Zemfrog unit testing tools
https://github.com/zemfrog/zemfrog-test
zemfrog
Last synced: about 1 year ago
JSON representation
Zemfrog unit testing tools
- Host: GitHub
- URL: https://github.com/zemfrog/zemfrog-test
- Owner: zemfrog
- License: mit
- Created: 2021-03-24T19:04:15.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-11T01:56:30.000Z (about 5 years ago)
- Last Synced: 2025-03-07T18:16:45.746Z (over 1 year ago)
- Topics: zemfrog
- Language: Python
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zemfrog-test
Zemfrog unit testing tools
# Features
* Support automatically create unit tests for API / blueprints
* Available fixtures:
- client
> This is to access the Client class to interact with the API
- app_ctx
> This is to enable the flask context application
- req_ctx
> This is to activate the flask request context application
- user
> This is to generate confirmed random users
# Warning
zemfrog test is available a finalizer to delete all users when the test session ends. so you need to create a special database for testing.
# Usage
Install this
```sh
pip install zemfrog-test
```
And add it to the `COMMANDS` configuration in the zemfrog application.
```python
COMMANDS = ["zemfrog_test"]
```
Now that you have the `test` command, here is a list of supported commands:
* `init` - Initialize the tests directory in the project directory.
* `new` - Create unit tests for the API or blueprint. (The names entered must match `APIS` and `BLUEPRINTS` configurations. For example `zemfrog_auth.jwt`)
* `run` - To run unit tests. **It doesn't work with the `pytest` command, don't know why. :/**