-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(credentials): drop API version prefix from the endpoint (#166)
feat(credentials): drop API version prefix from the endpoint Ref: #160 --------- Co-authored-by: Tomáš Dvořák <toomas2d@gmail.com> Co-authored-by: David Kristek <David.Kristek@ibm.com>
- Loading branch information
1 parent
c181afd
commit d7cd7f7
Showing
3 changed files
with
39 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import pytest | ||
|
||
from genai import Credentials | ||
|
||
|
||
@pytest.mark.unit | ||
class TestCredentials: | ||
@pytest.mark.filterwarnings("ignore::DeprecationWarning") | ||
def test_remove_version(self): | ||
credentials = Credentials(api_key="GENAI_API_KEY", api_endpoint="https://workbench-api.res.ibm.com/v1/") | ||
|
||
assert "/v1" not in credentials.api_endpoint | ||
|
||
credentials = Credentials(api_key="GENAI_API_KEY", api_endpoint="https://workbench-api.res.ibm.com/v2/ai/v12") | ||
|
||
assert credentials.api_endpoint == "https://workbench-api.res.ibm.com/v2/ai" |