diff --git a/test/aprsme/device_identification_test.exs b/test/aprsme/device_identification_test.exs index 17793b3..a2dade6 100644 --- a/test/aprsme/device_identification_test.exs +++ b/test/aprsme/device_identification_test.exs @@ -203,6 +203,17 @@ defmodule Aprsme.DeviceIdentificationTest do end end + describe "fetch_and_upsert_devices circuit-breaker path" do + test "returns an error tuple when circuit breaker rejects or HTTP fails" do + # This just exercises the fetch_and_upsert_devices path, which runs via + # Aprsme.CircuitBreaker.call/3. Without an HTTP stub, this will get an + # error back from either the breaker or the underlying Req call. + result = DeviceIdentification.fetch_and_upsert_devices() + + assert match?({:error, _}, result) or result == :ok + end + end + describe "lookup_device_from_db fallback when cache is unavailable" do test "lookup_device_by_identifier falls back to direct DB when DeviceCache is unavailable" do Repo.delete_all(Devices)