(self)
| 84 | |
| 85 | class TestExtractCsp: |
| 86 | def test_csp_present(self): |
| 87 | resource = { |
| 88 | "contents": [ |
| 89 | { |
| 90 | "uri": "ui://test", |
| 91 | "text": "<html></html>", |
| 92 | "_meta": { |
| 93 | "ui": {"csp": {"connectDomains": ["https://api.example.com"]}} |
| 94 | }, |
| 95 | } |
| 96 | ] |
| 97 | } |
| 98 | csp = AppHostServer._extract_csp(resource) |
| 99 | assert csp == {"connectDomains": ["https://api.example.com"]} |
| 100 | |
| 101 | def test_csp_absent(self): |
| 102 | resource = {"contents": [{"uri": "ui://test", "text": "<html></html>"}]} |
nothing calls this directly
no test coverage detected