# `Alternera.Resource.Test.Host`
[🔗](https://github.com/10e-ab/alternera-sdk/blob/v0.9.0/alternera_resource_sdk/lib/alternera/resource/test/host.ex#L1)

The host a package's own tests run against, with no proxy around.

An actor is a map: `%{system: true}` for the system, or
`%{id: uuid, roles: %{tenant_id => role}}`, where any role may read and
`:tenant_admin` may write. Resources are available unless a test turns them
off with `put_available(false)`; the setting is per process (and the processes it
starts, through `$callers`), so async tests do not see each other's.
`changed/3` sends `{:resource_changed, tenant_id, name, key}` to the
calling process, so a test can `assert_received` it.

# `actor`

```elixir
@spec actor([String.t()], atom()) :: map()
```

A stand-in user with `role` in each of `tenant_ids`.

# `put_available`

```elixir
@spec put_available(boolean()) :: :ok
```

Makes resources available or not for the calling process and its callees.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
