CycloneDX / CycloneDX/cyclonedx-python-lib
docs: explain model fixture and snapshot workflow
- Lenguaje dominante
- Python
- Estrellas
- 116
- Forks
- 67
- Merge medio
- 8 d 2 h
- PR fusionados (30 d)
- 2
Descripción
### Description
The contributor documentation links to `tests/_data/snapshots/README.md`, but that file currently explains only how to regenerate snapshots. It does not explain how BOM model factories in `tests/_data/models.py` are discovered or how they feed the JSON, XML, and round-trip tests.
This gap came up in the maintainer guidance on #914: https://github.com/CycloneDX/cyclonedx-python-lib/pull/914#issuecomment-3562249425. The maintainer explicitly welcomed a dedicated documentation pull request.
### Proposed documentation
Document the existing workflow without changing test behavior:
- `get_bom_*` factory discovery and snapshot naming;
- `_invalid` fixtures;
- registration of deliberately incomplete dependency graphs;
- regenerating snapshots, reviewing only the intended files, and rerunning tests with snapshot recreation disabled.
### Acceptance
- The documented paths and collector names match the current default branch.
- The shared JSON/XML output and deserialization fixture tests pass.
- The full test suite remains green.
Guía de contribución
Línea de trabajo
Comienza con tests/_data/snapshots/README.md y compara sus indicaciones actuales con tests/_data/models.py y con las pruebas compartidas de fixtures de salida y deserialización JSON/XML. Documenta el descubrimiento existente de factories, la nomenclatura de snapshots, los fixtures _invalid, los grafos de dependencias incompletos y el flujo de revisión de la regeneración; se considera terminado cuando las rutas y los nombres de los collectors coinciden con el default branch y las pruebas especificadas y la suite completa pasan con la recreación deshabilitada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- documentation, testing
- Tipo de issue
- Documentación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Tranquilo
- Claridad
- Bien especificado
- Aptitud para principiantes
- 74/100