-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OPIK-515] implement opik client auth_check method (#805)
* Add new check_auth method * Add docstring * Fix lint errors * Temporary change opik installation path to check timeouts behavior * Update retry policy * Fix lint errors * Add comment to documentation cookbook workflow * Add e2e test for auth check
- Loading branch information
1 parent
63d1dbc
commit d5e1ac9
Showing
4 changed files
with
30 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import opik | ||
import pytest | ||
from opik.rest_api.core import api_error | ||
|
||
|
||
def test_auth_check__happyflow(opik_client: opik.Opik): | ||
# Assuming opik client is correctly configured for tests, no | ||
# exceptions must be raised. | ||
assert opik_client.auth_check() is None | ||
|
||
|
||
def test_auth_check__not_existing_workspace__api_error_raised(): | ||
opik_client = opik.Opik( | ||
workspace="workspace-that-does-not-exist-in-any-installation" | ||
) | ||
with pytest.raises(api_error.ApiError): | ||
opik_client.auth_check() |