Skip to content

Testing: Introduce pytest-based automated test suite for MUIO Flask backend #18

@sairamsharan

Description

@sairamsharan

Hi maintainers

The MUIO Flask backend currently does not have an automated testing suite. This makes it harder to confidently refactor code, verify endpoint behavior, and maintain long-term reliability as the project evolves.

Proposed Changes

  • Add pytest and pytest-flask as development dependencies

  • Create a structured test directory:

    tests/
    ├── conftest.py
    └── test_app.py

  • Implement reusable Flask test client fixtures that run the app in TESTING mode without starting the Waitress server

  • Add initial unit tests for core endpoints in API/app.py, including:

    • GET / → verify index is served successfully
    • GET /getSession → validate behavior when session is missing
    • POST /setSession → verify valid session persistence flow
    • POST /setSession (invalid payload) → validate error handling

Expected Benefits

  • Improves backend reliability
  • Enables safer future refactoring
  • Provides a foundation for expanding test coverage
  • Aligns the project with modern testing best practices

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions