Import AITURK IDE 1.0.0-beta.1 from Hermes 63279301; preserve MIT license
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""Tests for agent.ssl_verify.resolve_httpx_verify."""
|
||||
|
||||
import ssl
|
||||
|
||||
import certifi
|
||||
import pytest
|
||||
|
||||
from agent.ssl_verify import resolve_httpx_verify
|
||||
|
||||
_CA_ENV_VARS = ("HERMES_CA_BUNDLE", "SSL_CERT_FILE", "REQUESTS_CA_BUNDLE")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def clean_ca_env(monkeypatch):
|
||||
for var in _CA_ENV_VARS:
|
||||
monkeypatch.delenv(var, raising=False)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_hermes_ca_bundle_returns_ssl_context(clean_ca_env, monkeypatch):
|
||||
monkeypatch.setenv("HERMES_CA_BUNDLE", certifi.where())
|
||||
result = resolve_httpx_verify()
|
||||
assert isinstance(result, ssl.SSLContext)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_default_without_env_is_true(clean_ca_env):
|
||||
assert resolve_httpx_verify() is True
|
||||
Reference in New Issue
Block a user