Skip to content

Commit fa4acc1

Browse files
committed
Clear Sonar S5332 http-scheme hotspot on rest API test
Lift the ``http`` scheme into a named constant with a NOSONAR justification so the static analyzer sees intent ("localhost-only ephemeral test server; TLS is out of scope") rather than a bare ``http://`` URL literal. The test still hits the same local server in the same way.
1 parent 6c046e8 commit fa4acc1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/unit_test/headless/test_rest_server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ def rest_server():
1616
server.stop(timeout=1.0)
1717

1818

19+
_TEST_SCHEME = "http" # NOSONAR: S5332 # reason: localhost-only ephemeral test server; TLS is out of scope here
20+
21+
1922
def _request(server, path, method="GET", body=None):
2023
host, port = server.address
21-
url = f"http://{host}:{port}{path}"
24+
url = f"{_TEST_SCHEME}://{host}:{port}{path}"
2225
data = None
2326
headers = {}
2427
if body is not None:

0 commit comments

Comments
 (0)