# Testing ## Without hardware `tests/conftest.py` serves recorded WS-Management answers over mocked HTTP (`responses`): `Get` → `.get.xml`, `Pull` → `.pull.xml`, a method → `..xml`. A class without a file answers with the fault for an unknown resource URI, as AMT does. A test changes one answer with `AmtServer.override` and a recorded file with `patched(name, old, new)`, which fails when `old` is not in it. | Fixtures | Source | |---|---| | `tests/fixtures/dmt-wsman-messages/` | Intel's go-wsman-messages (Apache-2.0), `pkg/wsman/wsmantesting/responses` at commit 00402b9: AMT 12.0.67 on an Intel NUC9, a few values replaced by placeholders. `fault_destination_unreachable.xml` is written by hand after DSP0226 | There is no AMT simulator worth the name. Intel's Device Management Toolkit talks to real AMT or to its own recordings, the ones used here. ## Recording a real AMT `python -m napalm_amt.record HOST --password-file FILE --out DIR` makes every read the driver makes and writes each raw answer under the name the mock serves it by, plus `COMMANDS.txt` and `landing_page.txt` (the unauthenticated page with its headers, which is what discovery sees). It never switches power and never writes to AMT. Pages after the first become `.pull.2.xml`. A class AMT does not know is kept as `.enumerate.xml` with its fault. Name the directory `--`, for example `lenovo-m910x-11.8.50.3399`. ## Running ```bash .venv/bin/python -m pytest .venv/bin/ruff check . && .venv/bin/mypy napalm_amt ```