Download tests/test_nuclei_prequeue.py from wuhp/bbscanner: direct link, hf CLI and curl.
- Browser
- Download file 891 Bytes
-
https://huggingface.co/spaces/wuhp/bbscanner/resolve/main/tests/test_nuclei_prequeue.py
- Command line
-
hf download hf://spaces/wuhp/bbscanner/tests/test_nuclei_prequeue.py
-
curl -L -o test_nuclei_prequeue.py https://huggingface.co/spaces/wuhp/bbscanner/resolve/main/tests/test_nuclei_prequeue.py
891 Bytes
| from pathlib import Path | |
| def test_nuclei_configuration_is_preflighted_before_queuing(): | |
| source=Path("app/index.html").read_text() | |
| scan=source.split("async function scan(){",1)[1].split("async function inspectJwt()",1)[0] | |
| assert "scanOptions=pipelineOptions()" in scan | |
| assert "if(modules.includes('nuclei'))" in scan | |
| assert "await api('/nuclei/validate'" in scan | |
| assert scan.index("await api('/nuclei/validate'") < scan.index("api('/scans'") | |
| assert "options:scanOptions" in scan | |
| assert "Nuclei preflight failed before queuing" in scan | |
| def test_preflight_blocks_overbudget_selection_without_enqueueing(): | |
| source=Path("app/index.html").read_text() | |
| scan=source.split("async function scan(){",1)[1].split("async function inspectJwt()",1)[0] | |
| assert "if(!check.valid){" in scan | |
| assert "return message('Nuclei preflight blocked this scan:" in scan | |