|
|
e31a4313f4
|
test: add unit tests for pure helpers and HTTP clients
Add runnable unit tests (no external services required):
- internal/utils: FormatVector/ParseEmbedding (all type branches + round-trip),
AverageVector, TopWords (min-length + stopword filtering + ranking)
- internal/config: getEnvBool, splitComma, Load defaults/override
- internal/server: determinePlatform (did/npub/@-handle/64-hex/dotted) and
platformFromString
- internal/twitter: mocked Twitter API v2 (empty-token error, fetch+parse,
max_results clamping, non-200 error)
- internal/activitypub: mocked Mastodon API (constructor validation,
GetLatestNPosts, GetPost, non-200 error)
Not covered (require live services / heavy mocking): store sqlc queries +
pgvector migrations (need Postgres), nostr client (needs a relay), ollama
client (wraps the ollama/go API over HTTP), and server orchestration
(requestStyleProfile, enrichCrossPlatform, fetchProfilePosts, getSimilarProfiles
need a DB + platform clients).
Co-Authored-By: Claude (AI assistant) <noreply@anthropic.com>
|
2026-08-29 01:33:42 +02:00 |
|