test : add unit tests for handle_caret handle_tilde and handle_wildcard helpers
@tmdeveloper007 ya está trabajando en esto.
Desde el 3/8/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Summary of What Needs to be Done:
Add direct unit tests for the handle_caret, handle_tilde, and handle_wildcard helper functions in backend/secuscan/remediation.py. These are internal helpers used by semver_to_pep440. While semver_to_pep440 is tested in test_remediation_safety.py, the individual helpers are not tested directly, leaving edge cases uncovered.
Changes that Need to be Made:
Add tests to testing/backend/unit/test_remediation_safety.py (or create testing/backend/unit/test_remediation_helpers.py) covering:
-
handle_caret (ver_str: str) -> List[str]:
- handle_caret("1.2.3") == [">=1.2.3,<2.0.0"]
- handle_caret("0.2.3") == [">=0.2.3,<0.3.0"]
- handle_caret("0.0.3") == [">=0.0.3,<0.0.4"]
- handle_caret("0.1.0") == [">=0.1.0,<0.2.0"]
- handle_caret("0.0.1") == [">=0.0.1,<0.0.2"]
-
handle_tilde (ver_str: str) -> List[str]:
- handle_tilde("1.2.3") == [">=1.2.3,<1.3.0"]
- handle_tilde("1.2") == [">=1.2.0,<1.3.0"]
- handle_tilde("1") == [">=1.0.0,<2.0.0"]
-
handle_wildcard (part: str) -> List[str]:
- handle_wildcard("1") == [">=1.0.0,<2.0.0"]
- handle_wildcard("1.2") == [">=1.2.0,<1.3.0"]
- handle_wildcard("1.2.3") == [">=1.2.3,<1.3.0"]
- handle_wildcard("x") raises ValueError or returns empty list
- handle_wildcard("*") raises ValueError or returns empty list
Import from backend.secuscan.remediation directly. Note: These functions are prefixed with underscore in the module (e.g., _handle_caret). Use --noconftest for local runs.
Impact that it would Provide:
- Reliability: Tests the individual components of semver_to_pep440 in isolation
- Testing: Fills gaps left by existing semver_to_pep440 tests which only test the top-level function
- Maintainability: Makes future changes to these helpers safer with direct coverage
Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.
- Lenguaje dominante
- Python
- Estrellas
- 36
- Forks
- 234
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de utksh1/SecuScan
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
area:frontend good first issue level:intermediate priority:low type:testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
-
area:frontend good first issue level:intermediate priority:low type:testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
area:frontend good first issue level:beginner priority:low type:testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
area:frontend good first issue level:intermediate priority:low type:testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Todos los issues de utksh1/SecuScan
Issues similares
-
[BUG] HTTP lifecycle dispatch treats a NO_PROXY-only environment as corporate egress and skips the resolve-and-pinned sessionPosiblemente ocupada @bodapatisaikrishna la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
[integration]: NoMacSandboxAbiertoexternal
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
langchain-ai/docs#7652 ·
Los mantenedores suelen responder en 1 día
-
[oblt-aw][autodoc] Document new e2e-secret-leak-artifacts workflow and update e2e-all leaf listAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
elastic/oblt-aw#2513 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
amd/gaia#7326 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
NCAR/CLM-Tutorial#113 · 1 comentario ·
Los mantenedores suelen responder en 1 día