-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(python-sdk): organization environment variable and default client
* Use the correct environment variable `NUMEROUS_ORGANIZATION_ID`. * Define exception types for relevant exceptions in `_client` module. * Raise exception if organization ID is not configured. * Default to singleton client.
- Loading branch information
Showing
4 changed files
with
70 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import pytest | ||
|
||
from numerous._client import Client, _open_client | ||
from numerous._client import Client, _get_client | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def _set_env_vars(monkeypatch: pytest.MonkeyPatch) -> None: | ||
def test_open_client_returns_new_client(monkeypatch: pytest.MonkeyPatch) -> None: | ||
monkeypatch.setenv("NUMEROUS_API_URL", "url_value") | ||
monkeypatch.setenv("NUMEROUS_API_ACCESS_TOKEN", "token") | ||
monkeypatch.setenv("NUMEROUS_ORGANIZATION_ID", "organization-id") | ||
|
||
|
||
def test_open_client_returns_new_client() -> None: | ||
"""Testing client.""" | ||
client = _open_client() | ||
client = _get_client() | ||
|
||
assert isinstance(client, Client) |