TEST: command() refuses to run RPCs in :boot state
parent
cd0a0a3a13
commit
b5cad63a55
|
@ -6,6 +6,22 @@ defmodule FarmbotFirmware.CommandTest do
|
|||
import ExUnit.CaptureLog
|
||||
@subject FarmbotFirmware.Command
|
||||
|
||||
test "command() runs RPCs" do
|
||||
arg = [transport: FarmbotFirmware.StubTransport]
|
||||
{:ok, pid} = FarmbotFirmware.start_link(arg, [])
|
||||
send(pid, :timeout)
|
||||
{:error, message} = @subject.command(pid, {:a, {:b, :c}})
|
||||
assert "Can't send command when in :boot state" == message
|
||||
end
|
||||
|
||||
test "command() refuses to run RPCs in :boot state" do
|
||||
arg = [transport: FarmbotFirmware.StubTransport]
|
||||
{:ok, pid} = FarmbotFirmware.start_link(arg, [])
|
||||
send(pid, :timeout)
|
||||
{:error, message} = @subject.command(pid, {:a, {:b, :c}})
|
||||
assert "Can't send command when in :boot state" == message
|
||||
end
|
||||
|
||||
test "enable_debug_logs" do
|
||||
Application.put_env(:farmbot_firmware, @subject, foo: :bar, debug_log: false)
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ defmodule FarmbotFirmwareTest do
|
|||
doctest FarmbotFirmware
|
||||
|
||||
def try_command(pid, cmd) do
|
||||
# @subject.command(pid, cmd)
|
||||
GenServer.call(pid, cmd, :infinity)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue