Skip to content

Add unit tests for Flask membership/inventory app#1

Open
juntinyeh-worker wants to merge 1 commit intomainfrom
add-unit-tests
Open

Add unit tests for Flask membership/inventory app#1
juntinyeh-worker wants to merge 1 commit intomainfrom
add-unit-tests

Conversation

@juntinyeh-worker
Copy link
Copy Markdown
Owner

Summary

Adds a comprehensive pytest test suite (33 tests) covering all routes and models.

Test files

  • tests/conftest.py - Fixtures with in-memory SQLite (no MySQL needed)
  • tests/test_health.py - Health endpoint (1 test)
  • tests/test_members.py - Members CRUD API (10 tests)
  • tests/test_inventory.py - Inventory CRUD API + category filter (15 tests)
  • tests/test_models.py - Model defaults and unique constraints (6 tests)

How to run

pip install pytest
python -m pytest tests/ -v

All 33 tests pass.

- tests/conftest.py: pytest fixtures with in-memory SQLite
- tests/test_health.py: health endpoint test
- tests/test_members.py: CRUD tests for members API
- tests/test_inventory.py: CRUD + category filter tests for inventory API
- tests/test_models.py: model defaults and unique constraint tests
- 33 tests total, all passing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant