File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 22
33import pytest
44
5+ from embeddings .models .base import BaseEmbeddingModel
56from embeddings .models .registry import MODEL_REGISTRY , get_model_class
67
78
@@ -46,3 +47,17 @@ def test_get_model_class_returns_correct_class():
4647def test_get_model_class_raises_for_unknown_uri ():
4748 with pytest .raises (ValueError , match = "Unknown model URI" ):
4849 get_model_class ("unknown/model-uri" )
50+
51+
52+ def test_subclass_without_model_uri_raises_type_error ():
53+ with pytest .raises (TypeError , match = "must define 'MODEL_URI' class attribute" ):
54+
55+ class InvalidModel (BaseEmbeddingModel ):
56+ pass
57+
58+
59+ def test_subclass_with_non_string_model_uri_raises_type_error ():
60+ with pytest .raises (TypeError , match = "must override 'MODEL_URI' with a valid string" ):
61+
62+ class InvalidModel (BaseEmbeddingModel ):
63+ MODEL_URI = 123
You can’t perform that action at this time.
0 commit comments