MCPcopy Create free account
hub / github.com/tirth8205/code-review-graph / test_roundtrip

Method test_roundtrip

tests/test_embeddings.py:27–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

25
26class TestVectorEncoding:
27 def test_roundtrip(self):
28 original = [1.0, 2.5, -3.14, 0.0, 100.0]
29 blob = _encode_vector(original)
30 decoded = _decode_vector(blob)
31 assert len(decoded) == len(original)
32 for a, b in zip(original, decoded):
33 assert abs(a - b) < 1e-5
34
35 def test_empty_vector(self):
36 blob = _encode_vector([])

Callers

nothing calls this directly

Calls 2

_encode_vectorFunction · 0.90
_decode_vectorFunction · 0.90

Tested by

no test coverage detected