Download tests/test_clients.py from HassamGani/ReOrgBench: direct link, hf CLI and curl.
- Browser
- Download file 709 Bytes
-
https://huggingface.co/datasets/HassamGani/ReOrgBench/resolve/main/tests/test_clients.py
- Command line
-
hf download hf://datasets/HassamGani/ReOrgBench/tests/test_clients.py
-
curl -L -o test_clients.py https://huggingface.co/datasets/HassamGani/ReOrgBench/resolve/main/tests/test_clients.py
709 Bytes
| from reorgbench.harness.clients import OpenAIClient, _infra_status, make_client | |
| class _E(Exception): | |
| def __init__(self, code, msg): | |
| super().__init__(msg) | |
| self.status_code = code | |
| def test_billing_and_auth_errors_are_infrastructure(): | |
| assert _infra_status(_E(400, "Your credit balance is too low to access the Anthropic API.")) | |
| assert _infra_status(_E(429, "insufficient_quota")) | |
| assert _infra_status(_E(401, "invalid x-api-key")) | |
| assert not _infra_status(_E(400, "messages: field required")) | |
| def test_openai_specs_get_an_openai_client(monkeypatch): | |
| monkeypatch.setenv("OPENAI_API_KEY", "test") | |
| assert isinstance(make_client("openai:some-model"), OpenAIClient) | |