File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,18 @@ def test_create_collection(client: vecs.Client) -> None:
1717 client .create_collection (name = "docs" , dimension = 384 )
1818
1919
20+ def test_get_or_create_collection (client : vecs .Client ) -> None :
21+ client .get_or_create_collection (name = "resumes" , dimension = 1536 )
22+ # no error is raised
23+ client .get_or_create_collection (name = "resumes" , dimension = 1536 )
24+
25+
26+ def test_get_or_create_collection_dim_change (client : vecs .Client ) -> None :
27+ client .get_or_create_collection (name = "resumes" , dimension = 1536 )
28+ with pytest .raises (vecs .exc .MismatchedDimension ):
29+ client .get_or_create_collection (name = "resumes" , dimension = 1 )
30+
31+
2032def test_get_collection (client : vecs .Client ) -> None :
2133 with pytest .warns (DeprecationWarning ):
2234 with pytest .raises (vecs .exc .CollectionNotFound ):
You can’t perform that action at this time.
0 commit comments