f-37: add test for error state #37
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
fa72b6cd47
commit
78363194bf
2 changed files with 73 additions and 0 deletions
|
|
@ -25,10 +25,18 @@ func newTestDispatcher(t *testing.T) (*Dispatcher, *badger.DB) {
|
|||
|
||||
// mockCmd implémente Command sans aucune dépendance système.
|
||||
type mockCmd struct {
|
||||
key string
|
||||
prepareFn func(*badger.DB, *configuration.Config) error
|
||||
executeFn func(*badger.DB, *configuration.Config) error
|
||||
}
|
||||
|
||||
func (m mockCmd) Key() string {
|
||||
if m.key == "" {
|
||||
return "vpc/mock"
|
||||
}
|
||||
return m.key
|
||||
}
|
||||
|
||||
func (m mockCmd) Prepare(db *badger.DB, cfg *configuration.Config) error {
|
||||
return m.prepareFn(db, cfg)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue