22 lines
798 B
Elixir
22 lines
798 B
Elixir
ExUnit.start()
|
|
|
|
# Exclude integration tests by default
|
|
# Run them with: mix test --only integration
|
|
ExUnit.configure(exclude: [:integration])
|
|
|
|
# Define mocks for testing
|
|
Mox.defmock(Towerops.Monitoring.PingMock, for: Towerops.Monitoring.PingBehaviour)
|
|
Mox.defmock(Towerops.Snmp.PollerMock, for: Towerops.Snmp.PollerBehaviour)
|
|
Mox.defmock(Towerops.Snmp.SnmpMock, for: Towerops.Snmp.SnmpBehaviour)
|
|
|
|
# Define stub module for SNMP mock (returns errors for all calls)
|
|
defmodule Towerops.Snmp.SnmpMockStub do
|
|
@moduledoc false
|
|
@behaviour Towerops.Snmp.SnmpBehaviour
|
|
|
|
def get(_target, _oid, _opts), do: {:error, :timeout}
|
|
def walk(_target, _oid, _opts), do: {:error, :timeout}
|
|
def get_bulk(_target, _oid, _opts), do: {:error, :timeout}
|
|
end
|
|
|
|
Ecto.Adapters.SQL.Sandbox.mode(Towerops.Repo, :manual)
|