fix(tls): replace raw urllib with requests for external HTTPS calls (frozen-build cert failures) (#903)

Co-authored-by: Jonathan Singer <jonathansinger@Mac-4051.lan>
Co-authored-by: Ahmed Allam <ahmed39652003@gmail.com>
This commit is contained in:
yoni-at-strix
2026-07-27 12:34:26 -07:00
committed by GitHub
co-authored by Jonathan Singer Ahmed Allam
parent 37c7f5a6ba
commit 86282e83a8
6 changed files with 49 additions and 55 deletions
+14
View File
@@ -7,8 +7,10 @@ import hashlib
import json
import time
from typing import TYPE_CHECKING, Any
from unittest import mock
import pytest
import requests
from strix.config import codex
@@ -52,6 +54,18 @@ def test_authorize_url_carries_pkce_and_client() -> None:
assert "state=st8" in url
def test_post_form_returns_parsed_body() -> None:
resp = mock.MagicMock()
resp.status_code = 200
resp.content = b'{"access_token": "tok"}'
with mock.patch.object(requests, "post", return_value=resp) as post:
data = codex._post_form({"grant_type": "refresh_token"})
assert data == {"access_token": "tok"}
assert post.call_args.kwargs["timeout"] == codex._TOKEN_TIMEOUT
@pytest.mark.parametrize(
("value", "expected"),
[