TEST (40.1%): command() runs RPCs

pull/1130/head
Rick Carlino 2020-01-31 14:22:47 -06:00
parent b5cad63a55
commit b36044662a
1 changed files with 8 additions and 2 deletions

View File

@ -6,12 +6,18 @@ defmodule FarmbotFirmware.CommandTest do
import ExUnit.CaptureLog
@subject FarmbotFirmware.Command
@tag :this_is_the_bug
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
assert {:error, :emergency_lock} ==
@subject.command(pid, {:command_emergency_lock, []})
assert :ok == @subject.command(pid, {:command_emergency_unlock, []})
cmd = {:parameter_write, [movement_stop_at_home_x: 0.0]}
assert :ok == @subject.command(pid, cmd)
end
test "command() refuses to run RPCs in :boot state" do