"""Tests for execution detail server name resolution."""

from server.application.services.script_service import ScriptService


def test_execution_server_id_set_from_json_and_results():
    ids = ScriptService._execution_server_id_set(
        "[219, 223, 225]",
        {"219": {"status": "failed"}, "999": {"status": "failed"}, "_meta": {}},
    )
    assert ids == {219, 223, 225, 999}


def test_execution_server_id_set_empty():
    assert ScriptService._execution_server_id_set(None, {}) == set()
