diff --git a/CHANGES.rst b/CHANGES.rst index 35dbc7d8..7ac55270 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,6 +20,7 @@ in progress - [ntfy] Also interpolate outbound ntfy option fields - [ntfy] [Frigate] Improve example/tutorial about Frigate event notifications - [ntfy] [Frigate] Synchronize JSON event and snapshot image receive order +- [ntfy] [Frigate] Tests: Verify notification was properly received by ntfy 2023-04-11 0.33.0 diff --git a/examples/frigate/test_frigate.py b/examples/frigate/test_frigate.py index 81dd7feb..41b126ce 100644 --- a/examples/frigate/test_frigate.py +++ b/examples/frigate/test_frigate.py @@ -110,6 +110,28 @@ def test_frigate_with_attachment(mosquitto, ntfy_service, caplog, capmqtt): assert "Job queue has 0 items to process" in caplog.messages mqttc.disconnect() + # Verify notification was properly received by ntfy. + url = "http://localhost:5555/frigate-testdrive/json?poll=1&since=5s" + response = requests.get(url) + data = response.json() + del data["id"] + del data["time"] + del data["expires"] + del data["attachment"]["url"] + del data["attachment"]["expires"] + assert data == { + "event": "message", + "topic": "frigate-testdrive", + "title": "goat entered lawn at 2023-04-06 14:31:46.638857+00:00", + "message": "goat was in barn before", + "click": "https://httpbin.org/anything?camera=cam-testdrive&label=goat&zone=lawn", + "attachment": { + "name": "mqttwarn-frigate-cam-testdrive-goat.png", + "size": 283595, + "type": "image/png", + }, + } + @pytest.mark.parametrize( "jsonfile", ["frigate-event-full.json", "frigate-event-new-good.json", "frigate-event-update-good.json"]