fix: add unit tests for memory/embeddings.py #440

Closed
kimi wants to merge 0 commits from kimi/issue-431 into main
Collaborator

Adds unit tests for timmy.memory.embeddings covering:

  • _simple_hash_embedding (determinism, normalization, edge cases)
  • cosine_similarity (identical, orthogonal, opposite, zero vectors)
  • _keyword_overlap (full, partial, no overlap, case insensitivity)
  • embed_text (fallback path and model path with mocking)
  • _get_embedding_model (skip setting, import errors)

Fixes #431

Adds unit tests for `timmy.memory.embeddings` covering: - `_simple_hash_embedding` (determinism, normalization, edge cases) - `cosine_similarity` (identical, orthogonal, opposite, zero vectors) - `_keyword_overlap` (full, partial, no overlap, case insensitivity) - `embed_text` (fallback path and model path with mocking) - `_get_embedding_model` (skip setting, import errors) Fixes #431
kimi added 1 commit 2026-03-19 15:13:34 +00:00
fix: add unit tests for memory/embeddings.py
All checks were successful
Tests / lint (pull_request) Successful in 2s
Tests / test (pull_request) Successful in 1m9s
ab0363f700
Tests cover _simple_hash_embedding, cosine_similarity, _keyword_overlap,
embed_text, and _get_embedding_model with proper mocking of the global
model state.

Fixes #431

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner

Closing as duplicate. PR#437 already merged equivalent embedding tests as tests/unit/test_memory_embeddings.py. This PR adds a near-identical test_embeddings.py — same coverage, same patterns. No need for both.

Closing as duplicate. PR#437 already merged equivalent embedding tests as `tests/unit/test_memory_embeddings.py`. This PR adds a near-identical `test_embeddings.py` — same coverage, same patterns. No need for both.
Timmy closed this pull request 2026-03-19 15:17:04 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#440