Summary of What Needs to be Done:
Add unit tests for the _validate_lengths function in backend/secuscan/routes.py. This function enforces maximum field lengths (255 for name, 2000 for description/notes) to prevent database and UI overflow issues.
Changes that Need to be Made:
- Create testing/backend/unit/test_routes_validate_lengths.py
- Test cases should cover:
- Valid name under 255 chars passes
- Valid description/notes under 2000 chars passes
- Name exactly 255 chars passes
- Name over 255 chars raises HTTPException with detail message
- Description exactly 2000 chars passes
- Description over 2000 chars raises HTTPException
- Notes over 2000 chars raises HTTPException
- Custom resource_type reflected in error message
- None values for optional fields pass
Impact that it would Provide:
- Prevents database column overflow from oversized inputs
- Ensures API returns meaningful validation errors
- Protects against malformed input reaching the database
Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.
Summary of What Needs to be Done:
Add unit tests for the _validate_lengths function in backend/secuscan/routes.py. This function enforces maximum field lengths (255 for name, 2000 for description/notes) to prevent database and UI overflow issues.
Changes that Need to be Made:
Impact that it would Provide:
Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.