feat(orchestrator): worker pool run + account testing gate
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package orchestrator
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/vasyansk/imap-copier/internal/store"
|
||||
)
|
||||
|
||||
func TestGateOK(t *testing.T) {
|
||||
ok := []store.Account{
|
||||
{TestSrcStatus: "ok", TestDstStatus: "ok"},
|
||||
{TestSrcStatus: "ok", TestDstStatus: "ok"},
|
||||
}
|
||||
if !gateOK(ok) {
|
||||
t.Fatal("all ok must pass gate")
|
||||
}
|
||||
bad := []store.Account{{TestSrcStatus: "ok", TestDstStatus: "fail"}}
|
||||
if gateOK(bad) {
|
||||
t.Fatal("any non-ok must fail gate")
|
||||
}
|
||||
if gateOK(nil) {
|
||||
t.Fatal("empty accounts must fail gate")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user