litellm/tests/unit/proxy/roi_calculator/test_oauth.py
moe-berri 1a7023366f
feat(roi): measure shipping velocity, quality, and recorded spend (#44426)
* feat(ui): prototype observed engineering ROI dashboard

* feat(roi): replace effort estimates with measured repository metrics

* fix(roi): finish connection recovery and generated API contracts

* fix(roi): show merged changes before accounts are linked

* fix(roi): preserve selected report tab across refreshes

* fix(roi): recover app authorization and keep detail values readable

* fix(roi): reuse the shared OAuth HTTP client

* feat(roi): combine providers and compare equal reporting periods

* docs: explain ROI metrics for first-time readers

* fix(roi): preserve connections and scheduled reports during setup

* ci(roi): assign database contracts to the active Postgres shard

* fix(roi): preserve issue counts and normalized connections

* fix(ui): compact ROI dashboard header and metrics

* fix(ui): show ROI repository count with expandable list

* fix(ui): wrap ROI controls within narrow panels

* fix(roi): restore sample report preview and simplify setup
2026-10-03 23:07:34 +00:00

25 lines
1.1 KiB
Python

from dataclasses import replace
from typing import Final
from pydantic import SecretStr
from litellm.proxy.roi_calculator.oauth import OAuthConfig
def test_app_urls_support_enterprise_and_a_gateway_path_prefix() -> None:
cloud: Final = OAuthConfig(
"github",
"https://api.github.com",
"https://github.com",
"test-client",
SecretStr("test-secret"),
"https://gateway.example.test/proxy",
"test-app",
)
enterprise: Final = replace(cloud, api_url="https://git.example.test/api/v3", base_url="https://git.example.test")
assert cloud.installation_url == cloud.base_url + "/apps/test-app/installations/new"
assert enterprise.installation_url == enterprise.base_url + "/github-apps/test-app/installations/new"
assert enterprise.cookie_path == "/proxy/roi-calculator/observed/oauth"
assert enterprise.redirect_uri.startswith(enterprise.proxy_url + "/roi-calculator/")
assert replace(cloud, provider="gitlab").installation_url is None
assert replace(cloud, app_slug="").installation_url is None