f-37: add test for error state #37

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-08-13 23:13:25 +02:00
commit 78363194bf
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
2 changed files with 73 additions and 0 deletions

View file

@ -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)
}