test: Aprsme.Is helper functions without server running

This commit is contained in:
Graham McIntire 2026-04-23 18:27:48 -05:00
parent acb147cdf2
commit e95dbb39e0
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -498,6 +498,21 @@ defmodule Aprsme.IsTest do
end
end
describe "send_message/3 and /1 helpers" do
test "three-arg send_message delegates to send_message/1 without server running" do
# GenServer not running → send_message/1 returns {:error, :not_connected}.
assert {:error, :not_connected} = Aprsme.Is.send_message("FROM", "TO", "hi")
end
test "set_filter/1 without server running returns not_connected" do
assert {:error, :not_connected} = Aprsme.Is.set_filter("r/0/0/1")
end
test "list_active_filters/0 without server running returns not_connected" do
assert {:error, :not_connected} = Aprsme.Is.list_active_filters()
end
end
describe "backpressure handling" do
test "activate with nil socket is a no-op" do
state = build_state(%{socket: nil, backpressure_active: false})