Files
panxiao81 83eb87bcec
test / python (pull_request) Successful in 9s
test / shell (pull_request) Successful in 15s
重命名为动态 Runner 并记录协议调度路线
2026-09-16 14:51:06 +00:00

17 lines
464 B
Python

import pytest
from gitea_dynamic_runner.jwt_broker import extract_svid
def test_extract_svid_from_spire_json():
assert extract_svid([
{"svids": [{"hint": "", "spiffe_id": "spiffe://example/ci", "svid": "jwt"}]},
{"bundles": {}},
]) == "jwt"
@pytest.mark.parametrize("document", [{}, [], [{"bundles": {}}]])
def test_extract_svid_rejects_unexpected_response(document):
with pytest.raises(ValueError):
extract_svid(document)