MCPcopy Create free account
hub / github.com/alibaba/zvec / test_init_with_valid_vector

Method test_init_with_valid_vector

python/tests/test_params.py:574–580  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

572 assert vq.param is None
573
574 def test_init_with_valid_vector(self):
575 vec = [0.1, 0.2, 0.3]
576 param = HnswQueryParam(ef=300)
577 vq = Query(field_name="embedding", vector=vec, param=param)
578 assert vq.field_name == "embedding"
579 assert vq.vector == vec
580 assert vq.param == param
581
582 def test_init_both_id_and_vector_raises_error(self):
583 with pytest.raises(ValueError):

Callers

nothing calls this directly

Calls 1

QueryClass · 0.90

Tested by

no test coverage detected