Add Mocked Tests: Apps (part 1)
Overview Add more test coverage for Pydo, specifically for Apps
Mocked Tests: tests/mocked/ Tests in the mocked directory include:
- Tests that validate the generated client has all the expected classes and methods for the respective API resources and operations.
- Tests that exercise individual operations against mocked responses.
These tests do not act against the real API so no real resources are created.
To run mocked tests, run:
make test-mocked
Instructions
- Clone this repo.
- If you haven't already, install Python (version: >= 3.7.2) through their official installer.
- CD into the directory and run make install
- Create file: tests/mocked/test_uptime.py
- Add tests for
apps. get_app_cpu_percentage_metrics,apps. get_app_restart_count_metrics_yml,apps.get_app_memory_percentage_metrics - API documentation is here
- Pydo Documentation is here
Hey @danaelhe . I would like to work on this issue. Can you please assign me to this? 🙂
Hacktoberfest 2024 Contribution
Hello Maintainers,
I’m excited to contribute to the Pydo project for Hacktoberfest 2024! 🎉 This PR focuses on increasing test coverage for the Apps module, specifically by adding mocked tests.
Changes Made: Created tests/mocked/test_uptime.py. Added tests for the following functions: apps.get_app_cpu_percentage_metrics apps.get_app_restart_count_metrics_yml apps.get_app_memory_percentage_metrics Benefits: Enhanced Test Coverage: Ensures that all critical API functions are validated against mocked responses, improving reliability. No Impact on Real Resources: Tests run against mocks, ensuring safety and efficiency during testing. You can run the mocked tests using make test-mocked.
Thank you for considering this PR for Hacktoberfest 2024! you can assign the pr to me
Hi @P-Potdar :dolphin: Could you please share the link to the PR you mentioned? We’d love to take a look at it. Thanks!
Hi @loosla
Should these test be written in the test_monitoring.py instead since they'll actually be testing methods of the Monitoring class?
I'd like to work on them.
Hi @giftcup, you are right. Tests should be in pydo/tests/mocked/test_monitoring.py
Good catch :rocket: I've updated the task description. Thanks.