Skip to content

Commit

Permalink
Fix set_servo_angle, get_sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
RickCarlino committed Jan 23, 2020
1 parent e1e8adf commit 9ba060c
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -166,11 +166,20 @@ defmodule FarmbotCeleryScript.SysCallsTest do
end

test "execute_script" do
err = {:error, "not installed"}

expect(Stubs, :execute_script, 2, fn "take-photo", env ->
if Map.get(env, :error) do
err
else
:ok
end
end)

assert :ok = SysCalls.execute_script(Stubs, "take-photo", %{})
assert_receive {:execute_script, ["take-photo", %{}]}

assert {:error, "not installed"} ==
SysCalls.execute_script(Stubs, "take-photo", %{})
assert err == SysCalls.execute_script(Stubs, "take-photo", %{error: true})
end

test "set_servo_angle errors" do
Expand Down

0 comments on commit 9ba060c

Please sign in to comment.