Stub color extractor in tests

Makes the test suite much faster
This commit is contained in:
Claudio Ortolina
2026-03-26 22:58:39 +00:00
parent 152b3ddb70
commit e575f2af9e
5 changed files with 35 additions and 3 deletions
+14
View File
@@ -0,0 +1,14 @@
defmodule MusicLibrary.Colors.FakeColorExtractor do
@moduledoc """
Test stub for `MusicLibrary.Colors.KMeansExtractor`.
Returns hardcoded colors to avoid CPU-intensive K-means clustering in tests.
"""
@behaviour MusicLibrary.Colors.Extractor
@impl true
def extract_dominant_colors(_image_data, _num_colors \\ 5) do
{:ok, ["#000000", "#c0c0c0", "#c08080", "#404000", "#804040"]}
end
end