Day 17 — Add basic tests for service CLI
Goal
Add basic automated tests for the service CLI project.
The goal is to start practicing testing and make sure the core service functions work correctly after refactoring and error handling.
Tasks
Practice topics
- Basic testing
- Test files
- Assertions
- Function behavior
- Test data
- Defensive programming checks
- Regression testing
Expected result
The project should include basic tests that verify the service CLI logic.
Example:
python3 test_service_cli.py
Day 17 — Add basic tests for service CLI
Goal
Add basic automated tests for the service CLI project.
The goal is to start practicing testing and make sure the core service functions work correctly after refactoring and error handling.
Tasks
day17service_cli.pyandservices.jsonfromday16test_service_cli.pyfileload_services()save_services()reset_services()list_services()show_status()start_service()stop_service()start_service()changes service status torunningstop_service()changes service status tostoppedreset_services()restores default servicesday17/README.mdREADME.mdPractice topics
Expected result
The project should include basic tests that verify the service CLI logic.
Example: