The URL a deployment registered by ``test_key`` would carry, or the bare mount URL for None, which is what a registration made outside any test gets.
(cache: CacheEdge, provider: Provider, test_key: str | None = TEST_KEY)
| 214 | |
| 215 | @contextmanager |
| 216 | def edge(cache: CacheEdge, provider: Provider, test_key: str | None = TEST_KEY) -> Generator[str, None, None]: |
| 217 | """The URL a deployment registered by ``test_key`` would carry, or the bare |
| 218 | mount URL for None, which is what a registration made outside any test gets.""" |
| 219 | upstream: Final = f"http://127.0.0.1:{provider.server_port}" |
| 220 | running: Final = start_provider_edge(cache, mounts={"openai": upstream}) |
| 221 | base: Final = running.edge.api_base("openai") |
| 222 | try: |
| 223 | yield f"{base if test_key is None else scoped_edge_base(base, test_key)}/v1/chat/completions" |
| 224 | finally: |
| 225 | running.shutdown() |
| 226 | |
| 227 | |
| 228 | @contextmanager |
no test coverage detected