Commit 1b4f7c5
authored
Add exhaustive pytest test suite (240 tests, all modules) (#601)
* Add exhaustive pytest test suite with 240 tests covering all modules
Comprehensive test coverage for a codebase that previously had zero tests:
- 7 test files covering parsers (20 parsers), obfuscators (4), packers (2),
planners (5), requirements (8), stockpile_svc, donut handler, and hook.py
- Lightweight fake objects in conftest.py shim all Caldera internals so
tests run standalone without a Caldera server
- Config: pytest.ini, tox.ini, .pre-commit-config.yaml
* Address Copilot review feedback on exhaustive pytest coverage
- Replace all hardcoded /tmp/stockpile-pytest/ paths with repo-relative
paths derived from Path(__file__).resolve().parents[1]
- Fix shutil.which patch target in test_service.py to use patch.object on
the loaded module (stockpile_svc imports via 'from shutil import which')
- Replace fixed /tmp/ dirs in test_packers.py with pytest tmp_path fixture
- Make base64_jumble randomness test deterministic by patching random.choice
- Fix BaseParser.line shim in conftest to match real implementation
(split on '\n', strip '\r', skip empty lines)
- Use monkeypatch.setitem for sys.modules injection in test_hook.py
- Move donut shim to a module-scoped autouse fixture in test_donut.py
- Remove contradictory --ignore=E501 from .pre-commit-config.yaml flake8 config1 parent c7d39a9 commit 1b4f7c5
File tree
13 files changed
+3131
-0
lines changed- tests
13 files changed
+3131
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Whitespace-only changes.
0 commit comments