File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919from unittest .mock import MagicMock , mock_open , patch
2020
2121import cohere
22+ from cohere .errors import NotFoundError
2223
2324if "tokenizers" not in sys .modules :
2425 tokenizers_stub = types .ModuleType ("tokenizers" )
@@ -472,11 +473,16 @@ def test_embed_english_v3(self):
472473
473474 def test_embed_light_v3 (self ):
474475 """Test embed-english-light-v3.0 model."""
475- response = self .client .embed (
476- model = "embed-english-light-v3.0" ,
477- texts = ["Test" ],
478- input_type = "search_document" ,
479- )
476+ try :
477+ response = self .client .embed (
478+ model = "embed-english-light-v3.0" ,
479+ texts = ["Test" ],
480+ input_type = "search_document" ,
481+ )
482+ except NotFoundError as exc :
483+ if "embed-english-light-v3.0" in str (exc ):
484+ self .skipTest ("embed-english-light-v3.0 is not available in the current OCI region/profile" )
485+ raise
480486 self .assertIsNotNone (response .embeddings )
481487 self .assertEqual (len (response .embeddings [0 ]), 384 )
482488
You can’t perform that action at this time.
0 commit comments