mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
The stdlib testing package now includes this interface, so we can remove our dependency on the external library.
40 lines
567 B
Go
40 lines
567 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package proclib
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/nomad/helper/testlog"
|
|
)
|
|
|
|
func MockWranglers(t testing.TB) *Wranglers {
|
|
return &Wranglers{
|
|
configs: &Configs{
|
|
Logger: testlog.HCLogger(t),
|
|
},
|
|
m: make(map[Task]ProcessWrangler),
|
|
create: mocks,
|
|
}
|
|
}
|
|
|
|
func mocks(Task) ProcessWrangler {
|
|
return new(mock)
|
|
}
|
|
|
|
type mock struct {
|
|
}
|
|
|
|
func (m *mock) Initialize() error {
|
|
return nil
|
|
}
|
|
|
|
func (m *mock) Kill() error {
|
|
return nil
|
|
}
|
|
|
|
func (m *mock) Cleanup() error {
|
|
return nil
|
|
}
|