feat: background remote agent updates survive SAC navigation (0.20.19)
This commit is contained in:
@@ -4,6 +4,7 @@ import uuid
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
import pytest
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.config import get_settings
|
||||
from app.models import Event, Host, Problem
|
||||
@@ -138,13 +139,14 @@ def test_delete_host_removes_events_and_problems(client, db_session, jwt_headers
|
||||
)
|
||||
db_session.commit()
|
||||
|
||||
r = client.delete(f"/api/v1/hosts/{h.id}", headers=jwt_headers)
|
||||
host_id = h.id
|
||||
r = client.delete(f"/api/v1/hosts/{host_id}", headers=jwt_headers)
|
||||
assert r.status_code == 200
|
||||
body = r.json()
|
||||
assert body["hostname"] == "test-host"
|
||||
assert body["deleted_events"] == 1
|
||||
assert body["deleted_problems"] == 1
|
||||
assert db_session.get(Host, h.id) is None
|
||||
assert db_session.scalar(select(Host.id).where(Host.id == host_id)) is None
|
||||
|
||||
|
||||
def test_delete_host_404(client, jwt_headers):
|
||||
|
||||
Reference in New Issue
Block a user