The test framework automatically generates expected output files when they don't exist. This is useful when adding new test data or creating new test classes.
For PDF/XML tests, you need pdftohtml installed:
# Ubuntu/Debian
sudo apt install poppler-utils
# macOS
brew install poppler
# Windows
# Download from https://blog.alivate.com.au/poppler-windows/To generate the missing XML expected files for the Sicoob tests:
# Run the Skippers tests (will auto-generate expected files)
python3 -m unittest tests.test_banco_sicoob.TestBancoSicoobSkippers
# Run the Vox tests (will auto-generate expected files)
python3 -m unittest tests.test_banco_sicoob.TestBancoSicoobVox
# Run all Sicoob tests to verify
python3 -m unittest tests.test_banco_sicoobAfter running the tests, the following expected files will be created:
tests/html/BoletoSicoob-Skippers-expected.html✓ (already committed)tests/html/BoletoSicoob-Vox-expected.html✓ (already committed)tests/xml/BoletoSicoob-Skippers-expected.xml(will be auto-generated)tests/xml/BoletoSicoob-Vox-expected.xml(will be auto-generated)tests/xml/Triplo-BoletoSicoob-Skippers-expected.xml(will be auto-generated)tests/xml/Triplo-BoletoSicoob-Vox-expected.xml(will be auto-generated)
The testutils.py module has been updated to:
- Detect test class name suffixes (e.g., "Skippers", "Vox")
- Create separate expected files for each test class variant
- Maintain backward compatibility with existing tests
- Test class:
TestBanco<BankName><Suffix> - Expected files:
<BoletoClass>-<Suffix>-expected.<ext>
Example:
- Test class:
TestBancoSicoobSkippers - Boleto class:
BoletoSicoob - Expected files:
BoletoSicoob-Skippers-expected.html,BoletoSicoob-Skippers-expected.xml
After generating the expected files, add them to git:
git add tests/xml/BoletoSicoob-Skippers-expected.xml
git add tests/xml/BoletoSicoob-Vox-expected.xml
git add tests/xml/Triplo-BoletoSicoob-Skippers-expected.xml
git add tests/xml/Triplo-BoletoSicoob-Vox-expected.xml
git commit -m "Add XML expected files for Sicoob real boleto tests"