Skip to content

Instantly share code, notes, and snippets.

View adkron's full-sized avatar

Amos King adkron

View GitHub Profile
defmodule Zwave.Command.Test do
use ExUnit.Case, async: true
alias Zwave.Command
test "A non matching type passes through when deserialized" do
thing = make_ref()
assert thing == Command.Deserializable.deserialize(thing)
end
test "A binary being serialized should be the same" do
defmodule Zwave.Command.EnterInclusion.Pattern do
@moduledoc false
defmacro pattern do
quote do
<<0x00, 0x4A, 0xC1, 0x01>>
end
end
end
defmodule Zwave.Command.EnterInclusion.Pattern do
@moduledoc false
defmacro pattern do
quote do
<<0x00, 0x4A, 0xC1, 0x01>>
end
end
end
@adkron
adkron / notes.md
Last active May 16, 2017 23:03
working on nerves UART OS X tests
  brew install socat
  socat -d -d pty,raw,echo=0 pty,raw,echo=0

When running socat I get an output with two serial ports. I put the two serial ports into NERVES_UART_PORT1 and NERVES_UART_PORT2 Running this gets all but 6 tests to pass.

No environment vars - 27 failures

defmodule Zave.Commander.Messenger.Test do
use ExUnit.Case, async: true
@subject Zwave.Commander.Messenger
defmodule TestCommandModule do
defstruct [:initiator, :message]
def initialize(initiator) do
%__MODULE__{initiator: initiator}
end
defmodule Zwave.Inclusion.Process.Test do
use ExUnit.Case, async: true
alias Zwave.Inclusion.{Command, Response}
use Zwave.Status
@subject Zwave.Inclusion.Procedure
@node_timeout_in_ms 60 * 1000
setup do
Zwave.Registry.subscribe(:sent)
:ok
defmodule Zwave.Controller do
@moduledoc """
Handles low level Zwave control
"""
alias Zwave.{
ControllerLocator,
Configuration,
Status,
}
defmodule Smartrentcloud.Mixfile do
use Mix.Project
alias Mix.Shell.{IO}
def project do
[apps_path: "apps",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
aliases: aliases(),
preferred_cli_env: [pipeline: :test],
defmodule Zipato do
@moduledoc """
Entry point for inteacting with the Zipato API
"""
alias Zipato.{Authentication, Transformer, Request}
@network Application.get_env(:zipato, :network)
@credentials Application.get_env(:zipato, :credentials)
@type serial :: String.t
defmodule Zipato.Sessions.Server.Test do
use ExUnit.Case, async: true
@subject Zipato.Sessions.Server
@creds Application.get_env(:zipato, :credentials)
alias Zipato.{TestHelper, Request}
alias HTTPoison.{Response}
defmodule TestImpl do
use GenServer