mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-11 01:02:10 +03:00
Merge 632c5cba01 into 8c99ac78b7
This commit is contained in:
commit
d4cb9fff87
1 changed files with 13 additions and 0 deletions
|
|
@ -55,6 +55,19 @@ def test_build_payload_shape_and_json_serializable():
|
|||
dump_json(payload) # must not raise
|
||||
|
||||
|
||||
def test_build_payload_missing_keys_serializable():
|
||||
payload = build_payload({}, {}, None, "ok")
|
||||
assert payload["tool"] == "netsleuth"
|
||||
assert payload["asn"] is None
|
||||
assert payload["at"] is None
|
||||
assert payload["previous"] is None
|
||||
assert payload["current"] == "ok"
|
||||
assert payload["score"] is None
|
||||
assert payload["findings"] == []
|
||||
assert payload["host"] is None
|
||||
dump_json(payload) # must not raise
|
||||
|
||||
|
||||
async def test_post_webhook_returns_true_on_success(httpx_mock):
|
||||
httpx_mock.add_response(url="https://example.com/hook", status_code=200)
|
||||
async with httpx.AsyncClient() as client:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue