test: add store_bad_packet binary+map inputs
This commit is contained in:
parent
0f4e5234f1
commit
fb1131159b
1 changed files with 15 additions and 0 deletions
|
|
@ -1097,4 +1097,19 @@ defmodule Aprsme.PacketsTest do
|
|||
assert result == [] or result == %{}
|
||||
end
|
||||
end
|
||||
|
||||
describe "store_bad_packet/2 map and binary inputs" do
|
||||
test "stores a bad packet from a binary raw packet" do
|
||||
assert {:ok, _} =
|
||||
Packets.store_bad_packet("BAD-RAW>APRS:corrupt", %{message: "parse error", type: "ParseError"})
|
||||
end
|
||||
|
||||
test "stores a bad packet from a map payload" do
|
||||
assert {:ok, _} =
|
||||
Packets.store_bad_packet(
|
||||
%{sender: "BAD-MAP", raw: "BAD-MAP>APRS:junk"},
|
||||
%{message: "schema error", type: "ValidationError"}
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue