Documentation
¶
Overview ¶
Package flowtest is what the tests of the adapters of docflow share: a manager over a store of a temporary directory, served over HTTP, with a clock of its own, and the far sides an exit sends to, in the process (an SMTP server, a web hook).
Index ¶
- Constants
- func Doc(t *testing.T, pages int) []byte
- func Header(data, name string) string
- type Env
- func (e *Env) Advance(d time.Duration)
- func (e *Env) Delivery(j *docflow.Job, node string) *docflow.Delivery
- func (e *Env) Job(number int32) *docflow.Job
- func (e *Env) M() *docflow.Manager
- func (e *Env) Now() time.Time
- func (e *Env) Payload(id string) []byte
- func (e *Env) Put(nodes ...docflow.Node) string
- func (e *Env) Required(valid docflow.Node)
- func (e *Env) Submit(dest, name string, doc []byte, meta map[string]any) *docflow.Job
- func (e *Env) Tick()
- type Hook
- type Mail
- type Request
- type SMTP
Constants ¶
const AdminToken = "admin-token-for-tests"
AdminToken authorizes the API of an Env.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
T *testing.T
St *docflow.Store
Opts docflow.Options
Srv *httptest.Server
// contains filtered or unexported fields
}
Env is a manager's store served over HTTP; every request makes a manager of its own, as a function of a serverless platform would.
func (*Env) Required ¶
Required checks the settings a kind says are required (Kind.Required, as the editor marks them) against its Check: valid is put, and none of those settings is left out of it (those whose If its settings fit) but the node is refused.
type Hook ¶
Hook is a web service that records what it gets and answers the statuses given, in turn (the last one after).